Text Generation
Transformers
Safetensors
gemma2
Generated from Trainer
sft
trl
hf_jobs
text-generation-inference
Instructions to use KexuanShi/sft_gemma2_2b_code_layerdrop_p005 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KexuanShi/sft_gemma2_2b_code_layerdrop_p005 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KexuanShi/sft_gemma2_2b_code_layerdrop_p005")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KexuanShi/sft_gemma2_2b_code_layerdrop_p005") model = AutoModelForCausalLM.from_pretrained("KexuanShi/sft_gemma2_2b_code_layerdrop_p005", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KexuanShi/sft_gemma2_2b_code_layerdrop_p005 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KexuanShi/sft_gemma2_2b_code_layerdrop_p005" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KexuanShi/sft_gemma2_2b_code_layerdrop_p005", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p005
- SGLang
How to use KexuanShi/sft_gemma2_2b_code_layerdrop_p005 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 "KexuanShi/sft_gemma2_2b_code_layerdrop_p005" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KexuanShi/sft_gemma2_2b_code_layerdrop_p005", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "KexuanShi/sft_gemma2_2b_code_layerdrop_p005" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KexuanShi/sft_gemma2_2b_code_layerdrop_p005", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use KexuanShi/sft_gemma2_2b_code_layerdrop_p005 with Docker Model Runner:
docker model run hf.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p005
Download checkpoint-378/trainer_state.json from KexuanShi/sft_gemma2_2b_code_layerdrop_p005: direct link, hf CLI and curl.
- Browser
- Download file 11.6 kB
-
https://huggingface.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p005/resolve/main/checkpoint-378/trainer_state.json
- Command line
-
hf download hf://KexuanShi/sft_gemma2_2b_code_layerdrop_p005/checkpoint-378/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p005/resolve/main/checkpoint-378/trainer_state.json
11.6 kB
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 2.0, | |
| "eval_steps": 500, | |
| "global_step": 378, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "entropy": 1.2536803647875785, | |
| "epoch": 0.05291005291005291, | |
| "grad_norm": 8.8125, | |
| "learning_rate": 3.2142857142857147e-06, | |
| "loss": 1.1722795486450195, | |
| "mean_token_accuracy": 0.7258133076131343, | |
| "num_tokens": 710093.0, | |
| "step": 10 | |
| }, | |
| { | |
| "entropy": 0.9760579235851765, | |
| "epoch": 0.10582010582010581, | |
| "grad_norm": 2.65625, | |
| "learning_rate": 6.785714285714287e-06, | |
| "loss": 0.9763177871704102, | |
| "mean_token_accuracy": 0.7567757397890091, | |
| "num_tokens": 1429271.0, | |
| "step": 20 | |
| }, | |
| { | |
| "entropy": 0.794147289544344, | |
| "epoch": 0.15873015873015872, | |
| "grad_norm": 2.46875, | |
| "learning_rate": 1.0357142857142859e-05, | |
| "loss": 0.8046525001525879, | |
| "mean_token_accuracy": 0.7873034350574016, | |
| "num_tokens": 2149735.0, | |
| "step": 30 | |
| }, | |
| { | |
| "entropy": 0.7088500954210758, | |
| "epoch": 0.21164021164021163, | |
| "grad_norm": 1.4609375, | |
| "learning_rate": 1.3928571428571429e-05, | |
| "loss": 0.7121071815490723, | |
| "mean_token_accuracy": 0.8070594437420369, | |
| "num_tokens": 2868867.0, | |
| "step": 40 | |
| }, | |
| { | |
| "entropy": 0.683020292967558, | |
| "epoch": 0.26455026455026454, | |
| "grad_norm": 1.46875, | |
| "learning_rate": 1.7500000000000002e-05, | |
| "loss": 0.68443603515625, | |
| "mean_token_accuracy": 0.8138657048344612, | |
| "num_tokens": 3582476.0, | |
| "step": 50 | |
| }, | |
| { | |
| "entropy": 0.6564815938472748, | |
| "epoch": 0.31746031746031744, | |
| "grad_norm": 1.4296875, | |
| "learning_rate": 1.999986795783372e-05, | |
| "loss": 0.6578450202941895, | |
| "mean_token_accuracy": 0.8192978233098984, | |
| "num_tokens": 4287689.0, | |
| "step": 60 | |
| }, | |
| { | |
| "entropy": 0.6446133196353913, | |
| "epoch": 0.37037037037037035, | |
| "grad_norm": 1.5859375, | |
| "learning_rate": 1.9997520638548385e-05, | |
| "loss": 0.651158332824707, | |
| "mean_token_accuracy": 0.8207244381308556, | |
| "num_tokens": 5011191.0, | |
| "step": 70 | |
| }, | |
| { | |
| "entropy": 0.6360202118754387, | |
| "epoch": 0.42328042328042326, | |
| "grad_norm": 1.3984375, | |
| "learning_rate": 1.9992239841688418e-05, | |
| "loss": 0.6350794792175293, | |
| "mean_token_accuracy": 0.8251068785786628, | |
| "num_tokens": 5714842.0, | |
| "step": 80 | |
| }, | |
| { | |
| "entropy": 0.6189912840723991, | |
| "epoch": 0.47619047619047616, | |
| "grad_norm": 1.328125, | |
| "learning_rate": 1.9984027116747914e-05, | |
| "loss": 0.622182559967041, | |
| "mean_token_accuracy": 0.8279523886740208, | |
| "num_tokens": 6424614.0, | |
| "step": 90 | |
| }, | |
| { | |
| "entropy": 0.6159785229712724, | |
| "epoch": 0.5291005291005291, | |
| "grad_norm": 1.3671875, | |
| "learning_rate": 1.997288487350878e-05, | |
| "loss": 0.617555046081543, | |
| "mean_token_accuracy": 0.8284852005541324, | |
| "num_tokens": 7139778.0, | |
| "step": 100 | |
| }, | |
| { | |
| "entropy": 0.6129939660429955, | |
| "epoch": 0.582010582010582, | |
| "grad_norm": 1.328125, | |
| "learning_rate": 1.9958816381333684e-05, | |
| "loss": 0.6128347873687744, | |
| "mean_token_accuracy": 0.8294584318995476, | |
| "num_tokens": 7852540.0, | |
| "step": 110 | |
| }, | |
| { | |
| "entropy": 0.6052542962133884, | |
| "epoch": 0.6349206349206349, | |
| "grad_norm": 1.3359375, | |
| "learning_rate": 1.994182576820673e-05, | |
| "loss": 0.6046356201171875, | |
| "mean_token_accuracy": 0.831394524872303, | |
| "num_tokens": 8568056.0, | |
| "step": 120 | |
| }, | |
| { | |
| "entropy": 0.6013224326074124, | |
| "epoch": 0.6878306878306878, | |
| "grad_norm": 1.3203125, | |
| "learning_rate": 1.9921918019522238e-05, | |
| "loss": 0.6063410758972168, | |
| "mean_token_accuracy": 0.8313738636672496, | |
| "num_tokens": 9276742.0, | |
| "step": 130 | |
| }, | |
| { | |
| "entropy": 0.5983927462249994, | |
| "epoch": 0.7407407407407407, | |
| "grad_norm": 1.3125, | |
| "learning_rate": 1.9899098976621922e-05, | |
| "loss": 0.5977112770080566, | |
| "mean_token_accuracy": 0.8335464030504227, | |
| "num_tokens": 9990163.0, | |
| "step": 140 | |
| }, | |
| { | |
| "entropy": 0.5922725383192301, | |
| "epoch": 0.7936507936507936, | |
| "grad_norm": 1.5078125, | |
| "learning_rate": 1.9873375335080915e-05, | |
| "loss": 0.5917873382568359, | |
| "mean_token_accuracy": 0.8347524181008339, | |
| "num_tokens": 10710006.0, | |
| "step": 150 | |
| }, | |
| { | |
| "entropy": 0.5920293003320694, | |
| "epoch": 0.8465608465608465, | |
| "grad_norm": 1.3046875, | |
| "learning_rate": 1.9844754642743164e-05, | |
| "loss": 0.5962053298950195, | |
| "mean_token_accuracy": 0.8335559628903866, | |
| "num_tokens": 11416822.0, | |
| "step": 160 | |
| }, | |
| { | |
| "entropy": 0.5966673269867897, | |
| "epoch": 0.8994708994708994, | |
| "grad_norm": 1.3828125, | |
| "learning_rate": 1.981324529750672e-05, | |
| "loss": 0.6019061088562012, | |
| "mean_token_accuracy": 0.83258865326643, | |
| "num_tokens": 12123118.0, | |
| "step": 170 | |
| }, | |
| { | |
| "entropy": 0.5854565776884556, | |
| "epoch": 0.9523809523809523, | |
| "grad_norm": 1.359375, | |
| "learning_rate": 1.9778856544859647e-05, | |
| "loss": 0.5845203399658203, | |
| "mean_token_accuracy": 0.8360438510775566, | |
| "num_tokens": 12831058.0, | |
| "step": 180 | |
| }, | |
| { | |
| "entropy": 0.5759805988520383, | |
| "epoch": 1.0052910052910053, | |
| "grad_norm": 1.3046875, | |
| "learning_rate": 1.9741598475167173e-05, | |
| "loss": 0.5696067810058594, | |
| "mean_token_accuracy": 0.839682175219059, | |
| "num_tokens": 13547943.0, | |
| "step": 190 | |
| }, | |
| { | |
| "entropy": 0.5275494448840619, | |
| "epoch": 1.0582010582010581, | |
| "grad_norm": 1.3984375, | |
| "learning_rate": 1.9701482020711004e-05, | |
| "loss": 0.5299928665161133, | |
| "mean_token_accuracy": 0.8484233327209949, | |
| "num_tokens": 14264772.0, | |
| "step": 200 | |
| }, | |
| { | |
| "entropy": 0.5196751751005649, | |
| "epoch": 1.1111111111111112, | |
| "grad_norm": 1.2109375, | |
| "learning_rate": 1.9658518952481543e-05, | |
| "loss": 0.5208037853240967, | |
| "mean_token_accuracy": 0.8509362854063511, | |
| "num_tokens": 14985565.0, | |
| "step": 210 | |
| }, | |
| { | |
| "entropy": 0.5303940393030644, | |
| "epoch": 1.164021164021164, | |
| "grad_norm": 1.3359375, | |
| "learning_rate": 1.9612721876724054e-05, | |
| "loss": 0.5318955421447754, | |
| "mean_token_accuracy": 0.8480072498321534, | |
| "num_tokens": 15701796.0, | |
| "step": 220 | |
| }, | |
| { | |
| "entropy": 0.5232694145292044, | |
| "epoch": 1.216931216931217, | |
| "grad_norm": 1.359375, | |
| "learning_rate": 1.9564104231239726e-05, | |
| "loss": 0.5231654167175293, | |
| "mean_token_accuracy": 0.8490844376385212, | |
| "num_tokens": 16412522.0, | |
| "step": 230 | |
| }, | |
| { | |
| "entropy": 0.529466836899519, | |
| "epoch": 1.2698412698412698, | |
| "grad_norm": 1.3046875, | |
| "learning_rate": 1.9512680281442745e-05, | |
| "loss": 0.5309067726135254, | |
| "mean_token_accuracy": 0.8485323786735535, | |
| "num_tokens": 17126523.0, | |
| "step": 240 | |
| }, | |
| { | |
| "entropy": 0.527790617197752, | |
| "epoch": 1.3227513227513228, | |
| "grad_norm": 1.3125, | |
| "learning_rate": 1.9458465116174534e-05, | |
| "loss": 0.5262090682983398, | |
| "mean_token_accuracy": 0.8493455089628696, | |
| "num_tokens": 17834934.0, | |
| "step": 250 | |
| }, | |
| { | |
| "entropy": 0.528411227837205, | |
| "epoch": 1.3756613756613756, | |
| "grad_norm": 1.265625, | |
| "learning_rate": 1.940147464327637e-05, | |
| "loss": 0.529714298248291, | |
| "mean_token_accuracy": 0.8480914957821369, | |
| "num_tokens": 18553413.0, | |
| "step": 260 | |
| }, | |
| { | |
| "entropy": 0.516933124884963, | |
| "epoch": 1.4285714285714286, | |
| "grad_norm": 1.296875, | |
| "learning_rate": 1.9341725584921712e-05, | |
| "loss": 0.5172879219055175, | |
| "mean_token_accuracy": 0.8517736725509166, | |
| "num_tokens": 19270191.0, | |
| "step": 270 | |
| }, | |
| { | |
| "entropy": 0.5223661050200462, | |
| "epoch": 1.4814814814814814, | |
| "grad_norm": 1.2421875, | |
| "learning_rate": 1.9279235472709554e-05, | |
| "loss": 0.5231949329376221, | |
| "mean_token_accuracy": 0.8496842503547668, | |
| "num_tokens": 19976552.0, | |
| "step": 280 | |
| }, | |
| { | |
| "entropy": 0.5293067336082459, | |
| "epoch": 1.5343915343915344, | |
| "grad_norm": 1.2421875, | |
| "learning_rate": 1.92140226425203e-05, | |
| "loss": 0.5295753479003906, | |
| "mean_token_accuracy": 0.8479710258543491, | |
| "num_tokens": 20676613.0, | |
| "step": 290 | |
| }, | |
| { | |
| "entropy": 0.5302139949053526, | |
| "epoch": 1.5873015873015874, | |
| "grad_norm": 1.28125, | |
| "learning_rate": 1.914610622913566e-05, | |
| "loss": 0.530374813079834, | |
| "mean_token_accuracy": 0.8484688423573971, | |
| "num_tokens": 21385978.0, | |
| "step": 300 | |
| }, | |
| { | |
| "entropy": 0.5183596257120371, | |
| "epoch": 1.6402116402116402, | |
| "grad_norm": 1.1953125, | |
| "learning_rate": 1.9075506160624068e-05, | |
| "loss": 0.519154167175293, | |
| "mean_token_accuracy": 0.8509341597557067, | |
| "num_tokens": 22094336.0, | |
| "step": 310 | |
| }, | |
| { | |
| "entropy": 0.5201449614018202, | |
| "epoch": 1.693121693121693, | |
| "grad_norm": 1.328125, | |
| "learning_rate": 1.900224315249343e-05, | |
| "loss": 0.5171724796295166, | |
| "mean_token_accuracy": 0.8508495308458806, | |
| "num_tokens": 22798906.0, | |
| "step": 320 | |
| }, | |
| { | |
| "entropy": 0.5111908499151468, | |
| "epoch": 1.746031746031746, | |
| "grad_norm": 1.2265625, | |
| "learning_rate": 1.8926338701612738e-05, | |
| "loss": 0.511273717880249, | |
| "mean_token_accuracy": 0.8524932019412518, | |
| "num_tokens": 23511239.0, | |
| "step": 330 | |
| }, | |
| { | |
| "entropy": 0.5265866108238697, | |
| "epoch": 1.798941798941799, | |
| "grad_norm": 1.265625, | |
| "learning_rate": 1.884781507990445e-05, | |
| "loss": 0.5289421558380127, | |
| "mean_token_accuracy": 0.8486531592905522, | |
| "num_tokens": 24231185.0, | |
| "step": 340 | |
| }, | |
| { | |
| "entropy": 0.5189403794705868, | |
| "epoch": 1.8518518518518519, | |
| "grad_norm": 1.2578125, | |
| "learning_rate": 1.8766695327809463e-05, | |
| "loss": 0.5158460140228271, | |
| "mean_token_accuracy": 0.8517816573381424, | |
| "num_tokens": 24944285.0, | |
| "step": 350 | |
| }, | |
| { | |
| "entropy": 0.5055529039353133, | |
| "epoch": 1.9047619047619047, | |
| "grad_norm": 1.1953125, | |
| "learning_rate": 1.8683003247526567e-05, | |
| "loss": 0.5064782619476318, | |
| "mean_token_accuracy": 0.8533773042261601, | |
| "num_tokens": 25670441.0, | |
| "step": 360 | |
| }, | |
| { | |
| "entropy": 0.5245815236121416, | |
| "epoch": 1.9576719576719577, | |
| "grad_norm": 1.2421875, | |
| "learning_rate": 1.8596763396028384e-05, | |
| "loss": 0.5262872219085694, | |
| "mean_token_accuracy": 0.8492341041564941, | |
| "num_tokens": 26379786.0, | |
| "step": 370 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 1890, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 10, | |
| "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": 4.860945833530491e+17, | |
| "train_batch_size": 8, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |