Instructions to use MuhammadMaazA/phi3-coding-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use MuhammadMaazA/phi3-coding-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-128k-instruct") model = PeftModel.from_pretrained(base_model, "MuhammadMaazA/phi3-coding-adapter") - Transformers
How to use MuhammadMaazA/phi3-coding-adapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MuhammadMaazA/phi3-coding-adapter") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MuhammadMaazA/phi3-coding-adapter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MuhammadMaazA/phi3-coding-adapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MuhammadMaazA/phi3-coding-adapter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MuhammadMaazA/phi3-coding-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MuhammadMaazA/phi3-coding-adapter
- SGLang
How to use MuhammadMaazA/phi3-coding-adapter with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MuhammadMaazA/phi3-coding-adapter" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MuhammadMaazA/phi3-coding-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MuhammadMaazA/phi3-coding-adapter" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MuhammadMaazA/phi3-coding-adapter", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MuhammadMaazA/phi3-coding-adapter with Docker Model Runner:
docker model run hf.co/MuhammadMaazA/phi3-coding-adapter
Download checkpoint-1163/trainer_state.json from MuhammadMaazA/phi3-coding-adapter: direct link, hf CLI and curl.
- Browser
- Download file 8.8 kB
-
https://huggingface.co/MuhammadMaazA/phi3-coding-adapter/resolve/main/checkpoint-1163/trainer_state.json
- Command line
-
hf download hf://MuhammadMaazA/phi3-coding-adapter/checkpoint-1163/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/MuhammadMaazA/phi3-coding-adapter/resolve/main/checkpoint-1163/trainer_state.json
8.8 kB
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 1163, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.021505376344086023, | |
| "grad_norm": 0.20223873853683472, | |
| "learning_rate": 0.00019587274290627687, | |
| "loss": 0.684, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.043010752688172046, | |
| "grad_norm": 0.15471471846103668, | |
| "learning_rate": 0.00019157351676698194, | |
| "loss": 0.5158, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.06451612903225806, | |
| "grad_norm": 0.18991973996162415, | |
| "learning_rate": 0.00018727429062768703, | |
| "loss": 0.4924, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.08602150537634409, | |
| "grad_norm": 0.14841178059577942, | |
| "learning_rate": 0.0001829750644883921, | |
| "loss": 0.4843, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.10752688172043011, | |
| "grad_norm": 0.14833126962184906, | |
| "learning_rate": 0.00017867583834909717, | |
| "loss": 0.482, | |
| "step": 125 | |
| }, | |
| { | |
| "epoch": 0.12903225806451613, | |
| "grad_norm": 0.12203475832939148, | |
| "learning_rate": 0.00017437661220980223, | |
| "loss": 0.4834, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.15053763440860216, | |
| "grad_norm": 0.15162743628025055, | |
| "learning_rate": 0.00017007738607050733, | |
| "loss": 0.4785, | |
| "step": 175 | |
| }, | |
| { | |
| "epoch": 0.17204301075268819, | |
| "grad_norm": 0.13962391018867493, | |
| "learning_rate": 0.0001657781599312124, | |
| "loss": 0.494, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.1935483870967742, | |
| "grad_norm": 0.1615317463874817, | |
| "learning_rate": 0.00016147893379191746, | |
| "loss": 0.4665, | |
| "step": 225 | |
| }, | |
| { | |
| "epoch": 0.21505376344086022, | |
| "grad_norm": 0.18397337198257446, | |
| "learning_rate": 0.00015717970765262253, | |
| "loss": 0.4894, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 0.23655913978494625, | |
| "grad_norm": 0.13035638630390167, | |
| "learning_rate": 0.00015288048151332762, | |
| "loss": 0.4757, | |
| "step": 275 | |
| }, | |
| { | |
| "epoch": 0.25806451612903225, | |
| "grad_norm": 0.14732472598552704, | |
| "learning_rate": 0.0001485812553740327, | |
| "loss": 0.4752, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 0.27956989247311825, | |
| "grad_norm": 0.14634062349796295, | |
| "learning_rate": 0.00014428202923473776, | |
| "loss": 0.4828, | |
| "step": 325 | |
| }, | |
| { | |
| "epoch": 0.3010752688172043, | |
| "grad_norm": 0.13563473522663116, | |
| "learning_rate": 0.00013998280309544282, | |
| "loss": 0.4875, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 0.3225806451612903, | |
| "grad_norm": 0.18935735523700714, | |
| "learning_rate": 0.00013568357695614792, | |
| "loss": 0.477, | |
| "step": 375 | |
| }, | |
| { | |
| "epoch": 0.34408602150537637, | |
| "grad_norm": 0.12452180683612823, | |
| "learning_rate": 0.00013138435081685296, | |
| "loss": 0.4759, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 0.3655913978494624, | |
| "grad_norm": 0.11475691199302673, | |
| "learning_rate": 0.00012708512467755805, | |
| "loss": 0.4701, | |
| "step": 425 | |
| }, | |
| { | |
| "epoch": 0.3870967741935484, | |
| "grad_norm": 0.15240037441253662, | |
| "learning_rate": 0.00012278589853826312, | |
| "loss": 0.4633, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 0.40860215053763443, | |
| "grad_norm": 0.13332103192806244, | |
| "learning_rate": 0.0001184866723989682, | |
| "loss": 0.4764, | |
| "step": 475 | |
| }, | |
| { | |
| "epoch": 0.43010752688172044, | |
| "grad_norm": 0.12083959579467773, | |
| "learning_rate": 0.00011418744625967325, | |
| "loss": 0.4641, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.45161290322580644, | |
| "grad_norm": 0.13380204141139984, | |
| "learning_rate": 0.00010988822012037833, | |
| "loss": 0.4694, | |
| "step": 525 | |
| }, | |
| { | |
| "epoch": 0.4731182795698925, | |
| "grad_norm": 0.12465644627809525, | |
| "learning_rate": 0.00010558899398108341, | |
| "loss": 0.4688, | |
| "step": 550 | |
| }, | |
| { | |
| "epoch": 0.4946236559139785, | |
| "grad_norm": 0.11857310682535172, | |
| "learning_rate": 0.00010128976784178847, | |
| "loss": 0.4652, | |
| "step": 575 | |
| }, | |
| { | |
| "epoch": 0.5161290322580645, | |
| "grad_norm": 0.12590761482715607, | |
| "learning_rate": 9.699054170249355e-05, | |
| "loss": 0.478, | |
| "step": 600 | |
| }, | |
| { | |
| "epoch": 0.5376344086021505, | |
| "grad_norm": 0.1139000728726387, | |
| "learning_rate": 9.269131556319863e-05, | |
| "loss": 0.4507, | |
| "step": 625 | |
| }, | |
| { | |
| "epoch": 0.5591397849462365, | |
| "grad_norm": 0.12646405398845673, | |
| "learning_rate": 8.83920894239037e-05, | |
| "loss": 0.4802, | |
| "step": 650 | |
| }, | |
| { | |
| "epoch": 0.5806451612903226, | |
| "grad_norm": 0.12067534774541855, | |
| "learning_rate": 8.409286328460876e-05, | |
| "loss": 0.4775, | |
| "step": 675 | |
| }, | |
| { | |
| "epoch": 0.6021505376344086, | |
| "grad_norm": 0.13150258362293243, | |
| "learning_rate": 7.979363714531384e-05, | |
| "loss": 0.4916, | |
| "step": 700 | |
| }, | |
| { | |
| "epoch": 0.6236559139784946, | |
| "grad_norm": 0.11777201294898987, | |
| "learning_rate": 7.549441100601891e-05, | |
| "loss": 0.5076, | |
| "step": 725 | |
| }, | |
| { | |
| "epoch": 0.6451612903225806, | |
| "grad_norm": 0.1362081915140152, | |
| "learning_rate": 7.119518486672399e-05, | |
| "loss": 0.4737, | |
| "step": 750 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "grad_norm": 0.13432231545448303, | |
| "learning_rate": 6.689595872742906e-05, | |
| "loss": 0.4659, | |
| "step": 775 | |
| }, | |
| { | |
| "epoch": 0.6881720430107527, | |
| "grad_norm": 0.11704669147729874, | |
| "learning_rate": 6.259673258813414e-05, | |
| "loss": 0.4635, | |
| "step": 800 | |
| }, | |
| { | |
| "epoch": 0.7096774193548387, | |
| "grad_norm": 0.13714410364627838, | |
| "learning_rate": 5.829750644883921e-05, | |
| "loss": 0.4668, | |
| "step": 825 | |
| }, | |
| { | |
| "epoch": 0.7311827956989247, | |
| "grad_norm": 0.1475558876991272, | |
| "learning_rate": 5.399828030954428e-05, | |
| "loss": 0.4802, | |
| "step": 850 | |
| }, | |
| { | |
| "epoch": 0.7526881720430108, | |
| "grad_norm": 0.13451053202152252, | |
| "learning_rate": 4.969905417024936e-05, | |
| "loss": 0.4758, | |
| "step": 875 | |
| }, | |
| { | |
| "epoch": 0.7741935483870968, | |
| "grad_norm": 0.1707237958908081, | |
| "learning_rate": 4.539982803095443e-05, | |
| "loss": 0.4721, | |
| "step": 900 | |
| }, | |
| { | |
| "epoch": 0.7956989247311828, | |
| "grad_norm": 0.11293122917413712, | |
| "learning_rate": 4.11006018916595e-05, | |
| "loss": 0.4455, | |
| "step": 925 | |
| }, | |
| { | |
| "epoch": 0.8172043010752689, | |
| "grad_norm": 0.15928679704666138, | |
| "learning_rate": 3.6801375752364576e-05, | |
| "loss": 0.4672, | |
| "step": 950 | |
| }, | |
| { | |
| "epoch": 0.8387096774193549, | |
| "grad_norm": 0.11904233694076538, | |
| "learning_rate": 3.250214961306965e-05, | |
| "loss": 0.4583, | |
| "step": 975 | |
| }, | |
| { | |
| "epoch": 0.8602150537634409, | |
| "grad_norm": 0.1470075398683548, | |
| "learning_rate": 2.8202923473774723e-05, | |
| "loss": 0.466, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 0.8817204301075269, | |
| "grad_norm": 0.14105826616287231, | |
| "learning_rate": 2.3903697334479794e-05, | |
| "loss": 0.4623, | |
| "step": 1025 | |
| }, | |
| { | |
| "epoch": 0.9032258064516129, | |
| "grad_norm": 0.1548405885696411, | |
| "learning_rate": 1.9604471195184867e-05, | |
| "loss": 0.4675, | |
| "step": 1050 | |
| }, | |
| { | |
| "epoch": 0.9247311827956989, | |
| "grad_norm": 0.1382945477962494, | |
| "learning_rate": 1.530524505588994e-05, | |
| "loss": 0.462, | |
| "step": 1075 | |
| }, | |
| { | |
| "epoch": 0.946236559139785, | |
| "grad_norm": 0.13733048737049103, | |
| "learning_rate": 1.1006018916595013e-05, | |
| "loss": 0.4852, | |
| "step": 1100 | |
| }, | |
| { | |
| "epoch": 0.967741935483871, | |
| "grad_norm": 0.13711115717887878, | |
| "learning_rate": 6.706792777300086e-06, | |
| "loss": 0.4524, | |
| "step": 1125 | |
| }, | |
| { | |
| "epoch": 0.989247311827957, | |
| "grad_norm": 0.13078077137470245, | |
| "learning_rate": 2.407566638005159e-06, | |
| "loss": 0.4582, | |
| "step": 1150 | |
| } | |
| ], | |
| "logging_steps": 25, | |
| "max_steps": 1163, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.064873996845056e+17, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |