Instructions to use haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("codellama/CodeLlama-7b-Instruct-hf") model = PeftModel.from_pretrained(base_model, "haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf") - Transformers
How to use haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf
- SGLang
How to use haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf 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 "haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf" \ --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": "haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf", "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 "haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf" \ --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": "haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf with Docker Model Runner:
docker model run hf.co/haihp02/dicplau7_codellama_CodeLlama-7b-Instruct-hf
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 0.9982668977469671, | |
| "eval_steps": 500, | |
| "global_step": 288, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.01733102253032929, | |
| "grad_norm": 19.921022415161133, | |
| "learning_rate": 7.904761904761904e-06, | |
| "loss": 1.9953, | |
| "mean_token_accuracy": 0.5539645373821258, | |
| "num_tokens": 880436.0, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.03466204506065858, | |
| "grad_norm": 3.1659767627716064, | |
| "learning_rate": 1.7785714285714282e-05, | |
| "loss": 0.4972, | |
| "mean_token_accuracy": 0.8168690085411072, | |
| "num_tokens": 1772847.0, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.05199306759098787, | |
| "grad_norm": 0.5697739720344543, | |
| "learning_rate": 2.7666666666666667e-05, | |
| "loss": 0.1821, | |
| "mean_token_accuracy": 0.9385778725147247, | |
| "num_tokens": 2629531.0, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.06932409012131716, | |
| "grad_norm": 0.8860486149787903, | |
| "learning_rate": 3.7547619047619045e-05, | |
| "loss": 0.1503, | |
| "mean_token_accuracy": 0.9442744374275207, | |
| "num_tokens": 3524533.0, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.08665511265164645, | |
| "grad_norm": 0.44097742438316345, | |
| "learning_rate": 4.7428571428571427e-05, | |
| "loss": 0.134, | |
| "mean_token_accuracy": 0.949429202079773, | |
| "num_tokens": 4410812.0, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.10398613518197573, | |
| "grad_norm": 0.46751534938812256, | |
| "learning_rate": 5.730952380952381e-05, | |
| "loss": 0.1097, | |
| "mean_token_accuracy": 0.9614084720611572, | |
| "num_tokens": 5270909.0, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.12131715771230503, | |
| "grad_norm": 0.7552158832550049, | |
| "learning_rate": 6.719047619047618e-05, | |
| "loss": 0.1009, | |
| "mean_token_accuracy": 0.9661354303359986, | |
| "num_tokens": 6155537.0, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 0.1386481802426343, | |
| "grad_norm": 0.3426048457622528, | |
| "learning_rate": 6.913492996222407e-05, | |
| "loss": 0.0927, | |
| "mean_token_accuracy": 0.9692380607128144, | |
| "num_tokens": 7022278.0, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.1559792027729636, | |
| "grad_norm": 0.4504334032535553, | |
| "learning_rate": 6.900613269644081e-05, | |
| "loss": 0.082, | |
| "mean_token_accuracy": 0.9722775280475616, | |
| "num_tokens": 7888445.0, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 0.1733102253032929, | |
| "grad_norm": 0.3792800009250641, | |
| "learning_rate": 6.877878337145818e-05, | |
| "loss": 0.0644, | |
| "mean_token_accuracy": 0.9791450917720794, | |
| "num_tokens": 8739903.0, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.19064124783362218, | |
| "grad_norm": 0.4420663118362427, | |
| "learning_rate": 6.845375120299803e-05, | |
| "loss": 0.0629, | |
| "mean_token_accuracy": 0.9785033941268921, | |
| "num_tokens": 9619078.0, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 0.20797227036395147, | |
| "grad_norm": 0.48077255487442017, | |
| "learning_rate": 6.803227887375121e-05, | |
| "loss": 0.0619, | |
| "mean_token_accuracy": 0.9787447690963745, | |
| "num_tokens": 10479136.0, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.22530329289428075, | |
| "grad_norm": 0.2977643609046936, | |
| "learning_rate": 6.751597778227777e-05, | |
| "loss": 0.0582, | |
| "mean_token_accuracy": 0.9807714521884918, | |
| "num_tokens": 11356129.0, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 0.24263431542461006, | |
| "grad_norm": 0.21869313716888428, | |
| "learning_rate": 6.690682188221032e-05, | |
| "loss": 0.0525, | |
| "mean_token_accuracy": 0.9822983920574189, | |
| "num_tokens": 12210168.0, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.25996533795493937, | |
| "grad_norm": 0.24062839150428772, | |
| "learning_rate": 6.620714013531474e-05, | |
| "loss": 0.0507, | |
| "mean_token_accuracy": 0.9837425649166107, | |
| "num_tokens": 13074272.0, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.2772963604852686, | |
| "grad_norm": 0.2703610062599182, | |
| "learning_rate": 6.541960760726255e-05, | |
| "loss": 0.0532, | |
| "mean_token_accuracy": 0.9837726652622223, | |
| "num_tokens": 13951028.0, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.29462738301559793, | |
| "grad_norm": 0.348715603351593, | |
| "learning_rate": 6.454723524015746e-05, | |
| "loss": 0.0452, | |
| "mean_token_accuracy": 0.9850515723228455, | |
| "num_tokens": 14853383.0, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 0.3119584055459272, | |
| "grad_norm": 0.23803335428237915, | |
| "learning_rate": 6.359335834091915e-05, | |
| "loss": 0.0472, | |
| "mean_token_accuracy": 0.9840892851352692, | |
| "num_tokens": 15724507.0, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.3292894280762565, | |
| "grad_norm": 0.16920039057731628, | |
| "learning_rate": 6.256162382953555e-05, | |
| "loss": 0.0451, | |
| "mean_token_accuracy": 0.9848921954631805, | |
| "num_tokens": 16566607.0, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 0.3466204506065858, | |
| "grad_norm": 0.32039910554885864, | |
| "learning_rate": 6.145597629593734e-05, | |
| "loss": 0.0511, | |
| "mean_token_accuracy": 0.9832945823669433, | |
| "num_tokens": 17476269.0, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.36395147313691506, | |
| "grad_norm": 0.2946508824825287, | |
| "learning_rate": 6.028064291880252e-05, | |
| "loss": 0.0462, | |
| "mean_token_accuracy": 0.9852570235729218, | |
| "num_tokens": 18336061.0, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 0.38128249566724437, | |
| "grad_norm": 0.18868154287338257, | |
| "learning_rate": 5.904011730395065e-05, | |
| "loss": 0.0441, | |
| "mean_token_accuracy": 0.9859723746776581, | |
| "num_tokens": 19197400.0, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.3986135181975737, | |
| "grad_norm": 0.3599472939968109, | |
| "learning_rate": 5.7739142304116696e-05, | |
| "loss": 0.0402, | |
| "mean_token_accuracy": 0.9861063182353973, | |
| "num_tokens": 20052933.0, | |
| "step": 115 | |
| }, | |
| { | |
| "epoch": 0.41594454072790293, | |
| "grad_norm": 0.2798216640949249, | |
| "learning_rate": 5.63826918857889e-05, | |
| "loss": 0.0389, | |
| "mean_token_accuracy": 0.9861369669437409, | |
| "num_tokens": 20928177.0, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.43327556325823224, | |
| "grad_norm": 0.38542649149894714, | |
| "learning_rate": 5.4975952112438574e-05, | |
| "loss": 0.0341, | |
| "mean_token_accuracy": 0.9876367330551148, | |
| "num_tokens": 21793162.0, | |
| "step": 125 | |
| }, | |
| { | |
| "epoch": 0.4506065857885615, | |
| "grad_norm": 0.2921411991119385, | |
| "learning_rate": 5.35243013168478e-05, | |
| "loss": 0.0359, | |
| "mean_token_accuracy": 0.9860971868038177, | |
| "num_tokens": 22681479.0, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.4679376083188908, | |
| "grad_norm": 0.19987064599990845, | |
| "learning_rate": 5.203328953834159e-05, | |
| "loss": 0.033, | |
| "mean_token_accuracy": 0.9898090362548828, | |
| "num_tokens": 23536222.0, | |
| "step": 135 | |
| }, | |
| { | |
| "epoch": 0.4852686308492201, | |
| "grad_norm": 0.3248032033443451, | |
| "learning_rate": 5.050861730354096e-05, | |
| "loss": 0.0305, | |
| "mean_token_accuracy": 0.9885973572731018, | |
| "num_tokens": 24414936.0, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.5025996533795494, | |
| "grad_norm": 0.21195006370544434, | |
| "learning_rate": 4.895611383176404e-05, | |
| "loss": 0.0346, | |
| "mean_token_accuracy": 0.9883223176002502, | |
| "num_tokens": 25296910.0, | |
| "step": 145 | |
| }, | |
| { | |
| "epoch": 0.5199306759098787, | |
| "grad_norm": 0.23912712931632996, | |
| "learning_rate": 4.7381714748401414e-05, | |
| "loss": 0.0289, | |
| "mean_token_accuracy": 0.9890963315963746, | |
| "num_tokens": 26140083.0, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.537261698440208, | |
| "grad_norm": 0.22459208965301514, | |
| "learning_rate": 4.579143939147321e-05, | |
| "loss": 0.0281, | |
| "mean_token_accuracy": 0.9906902074813843, | |
| "num_tokens": 27000947.0, | |
| "step": 155 | |
| }, | |
| { | |
| "epoch": 0.5545927209705372, | |
| "grad_norm": 0.28445667028427124, | |
| "learning_rate": 4.4191367798131114e-05, | |
| "loss": 0.0291, | |
| "mean_token_accuracy": 0.9899352192878723, | |
| "num_tokens": 27877835.0, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.5719237435008665, | |
| "grad_norm": 0.24794110655784607, | |
| "learning_rate": 4.2587617459091795e-05, | |
| "loss": 0.027, | |
| "mean_token_accuracy": 0.9906977355480194, | |
| "num_tokens": 28750062.0, | |
| "step": 165 | |
| }, | |
| { | |
| "epoch": 0.5892547660311959, | |
| "grad_norm": 0.2798149287700653, | |
| "learning_rate": 4.0986319929875456e-05, | |
| "loss": 0.0214, | |
| "mean_token_accuracy": 0.9938373386859893, | |
| "num_tokens": 29584073.0, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 0.6065857885615251, | |
| "grad_norm": 0.2256922572851181, | |
| "learning_rate": 3.939359738827107e-05, | |
| "loss": 0.0274, | |
| "mean_token_accuracy": 0.9910281479358674, | |
| "num_tokens": 30493103.0, | |
| "step": 175 | |
| }, | |
| { | |
| "epoch": 0.6239168110918544, | |
| "grad_norm": 0.18433739244937897, | |
| "learning_rate": 3.781553922765516e-05, | |
| "loss": 0.0266, | |
| "mean_token_accuracy": 0.9907304227352143, | |
| "num_tokens": 31367886.0, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 0.6412478336221837, | |
| "grad_norm": 0.17792819440364838, | |
| "learning_rate": 3.6258178775653865e-05, | |
| "loss": 0.0229, | |
| "mean_token_accuracy": 0.9927768170833587, | |
| "num_tokens": 32241872.0, | |
| "step": 185 | |
| }, | |
| { | |
| "epoch": 0.658578856152513, | |
| "grad_norm": 0.2896949052810669, | |
| "learning_rate": 3.4727470227158956e-05, | |
| "loss": 0.0256, | |
| "mean_token_accuracy": 0.9920165657997131, | |
| "num_tokens": 33090146.0, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 0.6759098786828422, | |
| "grad_norm": 0.15475758910179138, | |
| "learning_rate": 3.322926587988904e-05, | |
| "loss": 0.0198, | |
| "mean_token_accuracy": 0.9928617775440216, | |
| "num_tokens": 33946268.0, | |
| "step": 195 | |
| }, | |
| { | |
| "epoch": 0.6932409012131716, | |
| "grad_norm": 0.17668993771076202, | |
| "learning_rate": 3.1769293759530075e-05, | |
| "loss": 0.0196, | |
| "mean_token_accuracy": 0.9939430177211761, | |
| "num_tokens": 34838335.0, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.7105719237435009, | |
| "grad_norm": 0.1672198474407196, | |
| "learning_rate": 3.035313572000036e-05, | |
| "loss": 0.019, | |
| "mean_token_accuracy": 0.9942795395851135, | |
| "num_tokens": 35696643.0, | |
| "step": 205 | |
| }, | |
| { | |
| "epoch": 0.7279029462738301, | |
| "grad_norm": 0.1975901871919632, | |
| "learning_rate": 2.898620610256823e-05, | |
| "loss": 0.0232, | |
| "mean_token_accuracy": 0.9921872437000274, | |
| "num_tokens": 36594681.0, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 0.7452339688041595, | |
| "grad_norm": 0.191142275929451, | |
| "learning_rate": 2.767373103541428e-05, | |
| "loss": 0.0212, | |
| "mean_token_accuracy": 0.9928397178649903, | |
| "num_tokens": 37463957.0, | |
| "step": 215 | |
| }, | |
| { | |
| "epoch": 0.7625649913344887, | |
| "grad_norm": 0.20682832598686218, | |
| "learning_rate": 2.6420728452781278e-05, | |
| "loss": 0.0199, | |
| "mean_token_accuracy": 0.9933333337306977, | |
| "num_tokens": 38357527.0, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 0.779896013864818, | |
| "grad_norm": 0.2716505527496338, | |
| "learning_rate": 2.523198891010382e-05, | |
| "loss": 0.0222, | |
| "mean_token_accuracy": 0.9922467291355133, | |
| "num_tokens": 39241233.0, | |
| "step": 225 | |
| }, | |
| { | |
| "epoch": 0.7972270363951474, | |
| "grad_norm": 0.19001668691635132, | |
| "learning_rate": 2.4112057268466295e-05, | |
| "loss": 0.0209, | |
| "mean_token_accuracy": 0.9923349857330322, | |
| "num_tokens": 40109881.0, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 0.8145580589254766, | |
| "grad_norm": 0.29096758365631104, | |
| "learning_rate": 2.3065215318414493e-05, | |
| "loss": 0.0256, | |
| "mean_token_accuracy": 0.9918012678623199, | |
| "num_tokens": 40989898.0, | |
| "step": 235 | |
| }, | |
| { | |
| "epoch": 0.8318890814558059, | |
| "grad_norm": 0.18268224596977234, | |
| "learning_rate": 2.2095465409554474e-05, | |
| "loss": 0.0184, | |
| "mean_token_accuracy": 0.9939315497875214, | |
| "num_tokens": 41856051.0, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 0.8492201039861352, | |
| "grad_norm": 0.25573816895484924, | |
| "learning_rate": 2.1206515148526813e-05, | |
| "loss": 0.0196, | |
| "mean_token_accuracy": 0.9933596789836884, | |
| "num_tokens": 42735924.0, | |
| "step": 245 | |
| }, | |
| { | |
| "epoch": 0.8665511265164645, | |
| "grad_norm": 0.1488819718360901, | |
| "learning_rate": 2.040176322386022e-05, | |
| "loss": 0.016, | |
| "mean_token_accuracy": 0.9949212014675141, | |
| "num_tokens": 43615669.0, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 0.8838821490467937, | |
| "grad_norm": 0.1831093579530716, | |
| "learning_rate": 1.9684286411899473e-05, | |
| "loss": 0.0166, | |
| "mean_token_accuracy": 0.9946038603782654, | |
| "num_tokens": 44503843.0, | |
| "step": 255 | |
| }, | |
| { | |
| "epoch": 0.901213171577123, | |
| "grad_norm": 0.14144335687160492, | |
| "learning_rate": 1.9056827813487584e-05, | |
| "loss": 0.0147, | |
| "mean_token_accuracy": 0.9956230521202087, | |
| "num_tokens": 45376996.0, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 0.9185441941074524, | |
| "grad_norm": 0.15868957340717316, | |
| "learning_rate": 1.8521786366376354e-05, | |
| "loss": 0.0154, | |
| "mean_token_accuracy": 0.9951422095298768, | |
| "num_tokens": 46247841.0, | |
| "step": 265 | |
| }, | |
| { | |
| "epoch": 0.9358752166377816, | |
| "grad_norm": 0.19115042686462402, | |
| "learning_rate": 1.8081207673462145e-05, | |
| "loss": 0.0166, | |
| "mean_token_accuracy": 0.9950133621692657, | |
| "num_tokens": 47119713.0, | |
| "step": 270 | |
| }, | |
| { | |
| "epoch": 0.9532062391681109, | |
| "grad_norm": 0.25370219349861145, | |
| "learning_rate": 1.7736776181912865e-05, | |
| "loss": 0.0178, | |
| "mean_token_accuracy": 0.9936381220817566, | |
| "num_tokens": 48016981.0, | |
| "step": 275 | |
| }, | |
| { | |
| "epoch": 0.9705372616984402, | |
| "grad_norm": 0.15300053358078003, | |
| "learning_rate": 1.7489808743087434e-05, | |
| "loss": 0.0167, | |
| "mean_token_accuracy": 0.9948623299598693, | |
| "num_tokens": 48887308.0, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 0.9878682842287695, | |
| "grad_norm": 0.16295602917671204, | |
| "learning_rate": 1.7341249577869848e-05, | |
| "loss": 0.0179, | |
| "mean_token_accuracy": 0.9947715997695923, | |
| "num_tokens": 49749889.0, | |
| "step": 285 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 289, | |
| "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": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 2.6996040282155254e+18, | |
| "train_batch_size": 16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |