Text Generation
Transformers
Safetensors
gemma2
Generated from Trainer
trl
hf_jobs
sft
text-generation-inference
Instructions to use KexuanShi/sft_gemma2_2b_code_layerdrop_p010 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_p010 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_p010")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KexuanShi/sft_gemma2_2b_code_layerdrop_p010") model = AutoModelForCausalLM.from_pretrained("KexuanShi/sft_gemma2_2b_code_layerdrop_p010", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KexuanShi/sft_gemma2_2b_code_layerdrop_p010 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_p010" # 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_p010", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p010
- SGLang
How to use KexuanShi/sft_gemma2_2b_code_layerdrop_p010 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_p010" \ --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_p010", "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_p010" \ --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_p010", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use KexuanShi/sft_gemma2_2b_code_layerdrop_p010 with Docker Model Runner:
docker model run hf.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p010
Download checkpoint-378/trainer_state.json from KexuanShi/sft_gemma2_2b_code_layerdrop_p010: direct link, hf CLI and curl.
- Browser
- Download file 11.6 kB
-
https://huggingface.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p010/resolve/main/checkpoint-378/trainer_state.json
- Command line
-
hf download hf://KexuanShi/sft_gemma2_2b_code_layerdrop_p010/checkpoint-378/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/KexuanShi/sft_gemma2_2b_code_layerdrop_p010/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.7671512730419636, | |
| "epoch": 0.05291005291005291, | |
| "grad_norm": 14.8125, | |
| "learning_rate": 3.2142857142857147e-06, | |
| "loss": 1.706784439086914, | |
| "mean_token_accuracy": 0.6392517775297165, | |
| "num_tokens": 710093.0, | |
| "step": 10 | |
| }, | |
| { | |
| "entropy": 1.4565640933811665, | |
| "epoch": 0.10582010582010581, | |
| "grad_norm": 6.1875, | |
| "learning_rate": 6.785714285714287e-06, | |
| "loss": 1.4239604949951172, | |
| "mean_token_accuracy": 0.6772899225354194, | |
| "num_tokens": 1429271.0, | |
| "step": 20 | |
| }, | |
| { | |
| "entropy": 1.0071680538356305, | |
| "epoch": 0.15873015873015872, | |
| "grad_norm": 3.109375, | |
| "learning_rate": 1.0357142857142859e-05, | |
| "loss": 1.048217487335205, | |
| "mean_token_accuracy": 0.7393087036907673, | |
| "num_tokens": 2149735.0, | |
| "step": 30 | |
| }, | |
| { | |
| "entropy": 0.8510661780834198, | |
| "epoch": 0.21164021164021163, | |
| "grad_norm": 1.5703125, | |
| "learning_rate": 1.3928571428571429e-05, | |
| "loss": 0.8619060516357422, | |
| "mean_token_accuracy": 0.7765810377895832, | |
| "num_tokens": 2868867.0, | |
| "step": 40 | |
| }, | |
| { | |
| "entropy": 0.7774681895971298, | |
| "epoch": 0.26455026455026454, | |
| "grad_norm": 1.578125, | |
| "learning_rate": 1.7500000000000002e-05, | |
| "loss": 0.7852191925048828, | |
| "mean_token_accuracy": 0.7921242833137512, | |
| "num_tokens": 3582476.0, | |
| "step": 50 | |
| }, | |
| { | |
| "entropy": 0.7451388858258724, | |
| "epoch": 0.31746031746031744, | |
| "grad_norm": 1.5859375, | |
| "learning_rate": 1.999986795783372e-05, | |
| "loss": 0.748009204864502, | |
| "mean_token_accuracy": 0.7999738156795502, | |
| "num_tokens": 4287689.0, | |
| "step": 60 | |
| }, | |
| { | |
| "entropy": 0.729080930352211, | |
| "epoch": 0.37037037037037035, | |
| "grad_norm": 1.4921875, | |
| "learning_rate": 1.9997520638548385e-05, | |
| "loss": 0.7400224685668946, | |
| "mean_token_accuracy": 0.801699859648943, | |
| "num_tokens": 5011191.0, | |
| "step": 70 | |
| }, | |
| { | |
| "entropy": 0.7048044994473457, | |
| "epoch": 0.42328042328042326, | |
| "grad_norm": 1.4453125, | |
| "learning_rate": 1.9992239841688418e-05, | |
| "loss": 0.7069188117980957, | |
| "mean_token_accuracy": 0.8093748845160007, | |
| "num_tokens": 5714842.0, | |
| "step": 80 | |
| }, | |
| { | |
| "entropy": 0.6840555652976036, | |
| "epoch": 0.47619047619047616, | |
| "grad_norm": 1.3125, | |
| "learning_rate": 1.9984027116747914e-05, | |
| "loss": 0.6863717555999755, | |
| "mean_token_accuracy": 0.8138940587639809, | |
| "num_tokens": 6424614.0, | |
| "step": 90 | |
| }, | |
| { | |
| "entropy": 0.6870591521263123, | |
| "epoch": 0.5291005291005291, | |
| "grad_norm": 1.4140625, | |
| "learning_rate": 1.997288487350878e-05, | |
| "loss": 0.6901006698608398, | |
| "mean_token_accuracy": 0.8129441156983376, | |
| "num_tokens": 7139778.0, | |
| "step": 100 | |
| }, | |
| { | |
| "entropy": 0.6756624668836594, | |
| "epoch": 0.582010582010582, | |
| "grad_norm": 1.40625, | |
| "learning_rate": 1.9958816381333684e-05, | |
| "loss": 0.6771352767944336, | |
| "mean_token_accuracy": 0.81553890183568, | |
| "num_tokens": 7852540.0, | |
| "step": 110 | |
| }, | |
| { | |
| "entropy": 0.6655688174068928, | |
| "epoch": 0.6349206349206349, | |
| "grad_norm": 1.34375, | |
| "learning_rate": 1.994182576820673e-05, | |
| "loss": 0.667414665222168, | |
| "mean_token_accuracy": 0.8177205875515938, | |
| "num_tokens": 8568056.0, | |
| "step": 120 | |
| }, | |
| { | |
| "entropy": 0.6643485642969609, | |
| "epoch": 0.6878306878306878, | |
| "grad_norm": 1.296875, | |
| "learning_rate": 1.9921918019522238e-05, | |
| "loss": 0.6721675872802735, | |
| "mean_token_accuracy": 0.816884483397007, | |
| "num_tokens": 9276742.0, | |
| "step": 130 | |
| }, | |
| { | |
| "entropy": 0.6590477801859379, | |
| "epoch": 0.7407407407407407, | |
| "grad_norm": 1.3515625, | |
| "learning_rate": 1.9899098976621922e-05, | |
| "loss": 0.6590158462524414, | |
| "mean_token_accuracy": 0.8199199490249157, | |
| "num_tokens": 9990163.0, | |
| "step": 140 | |
| }, | |
| { | |
| "entropy": 0.649939077347517, | |
| "epoch": 0.7936507936507936, | |
| "grad_norm": 1.4609375, | |
| "learning_rate": 1.9873375335080915e-05, | |
| "loss": 0.6501528263092041, | |
| "mean_token_accuracy": 0.82164012119174, | |
| "num_tokens": 10710006.0, | |
| "step": 150 | |
| }, | |
| { | |
| "entropy": 0.6468971997499466, | |
| "epoch": 0.8465608465608465, | |
| "grad_norm": 1.296875, | |
| "learning_rate": 1.9844754642743164e-05, | |
| "loss": 0.6529253959655762, | |
| "mean_token_accuracy": 0.820851170271635, | |
| "num_tokens": 11416822.0, | |
| "step": 160 | |
| }, | |
| { | |
| "entropy": 0.6556476138532161, | |
| "epoch": 0.8994708994708994, | |
| "grad_norm": 1.296875, | |
| "learning_rate": 1.981324529750672e-05, | |
| "loss": 0.6604087829589844, | |
| "mean_token_accuracy": 0.8195641197264194, | |
| "num_tokens": 12123118.0, | |
| "step": 170 | |
| }, | |
| { | |
| "entropy": 0.6358714967966079, | |
| "epoch": 0.9523809523809523, | |
| "grad_norm": 1.3515625, | |
| "learning_rate": 1.9778856544859647e-05, | |
| "loss": 0.6365831375122071, | |
| "mean_token_accuracy": 0.8241398617625236, | |
| "num_tokens": 12831058.0, | |
| "step": 180 | |
| }, | |
| { | |
| "entropy": 0.6277156263589859, | |
| "epoch": 1.0052910052910053, | |
| "grad_norm": 1.25, | |
| "learning_rate": 1.9741598475167173e-05, | |
| "loss": 0.6229054927825928, | |
| "mean_token_accuracy": 0.827630003541708, | |
| "num_tokens": 13547943.0, | |
| "step": 190 | |
| }, | |
| { | |
| "entropy": 0.5929765947163105, | |
| "epoch": 1.0582010582010581, | |
| "grad_norm": 1.421875, | |
| "learning_rate": 1.9701482020711004e-05, | |
| "loss": 0.5976824760437012, | |
| "mean_token_accuracy": 0.8327139303088188, | |
| "num_tokens": 14264772.0, | |
| "step": 200 | |
| }, | |
| { | |
| "entropy": 0.5882044766098261, | |
| "epoch": 1.1111111111111112, | |
| "grad_norm": 1.1953125, | |
| "learning_rate": 1.9658518952481543e-05, | |
| "loss": 0.5882174968719482, | |
| "mean_token_accuracy": 0.8350941069424153, | |
| "num_tokens": 14985565.0, | |
| "step": 210 | |
| }, | |
| { | |
| "entropy": 0.5916924901306629, | |
| "epoch": 1.164021164021164, | |
| "grad_norm": 1.4140625, | |
| "learning_rate": 1.9612721876724054e-05, | |
| "loss": 0.5934844017028809, | |
| "mean_token_accuracy": 0.8336228899657726, | |
| "num_tokens": 15701796.0, | |
| "step": 220 | |
| }, | |
| { | |
| "entropy": 0.5877517074346542, | |
| "epoch": 1.216931216931217, | |
| "grad_norm": 1.34375, | |
| "learning_rate": 1.9564104231239726e-05, | |
| "loss": 0.589122200012207, | |
| "mean_token_accuracy": 0.8334487572312355, | |
| "num_tokens": 16412522.0, | |
| "step": 230 | |
| }, | |
| { | |
| "entropy": 0.5912774313241244, | |
| "epoch": 1.2698412698412698, | |
| "grad_norm": 1.3359375, | |
| "learning_rate": 1.9512680281442745e-05, | |
| "loss": 0.5940174102783203, | |
| "mean_token_accuracy": 0.83340530321002, | |
| "num_tokens": 17126523.0, | |
| "step": 240 | |
| }, | |
| { | |
| "entropy": 0.5930401895195245, | |
| "epoch": 1.3227513227513228, | |
| "grad_norm": 1.2265625, | |
| "learning_rate": 1.9458465116174534e-05, | |
| "loss": 0.5915824890136718, | |
| "mean_token_accuracy": 0.8344384111464024, | |
| "num_tokens": 17834934.0, | |
| "step": 250 | |
| }, | |
| { | |
| "entropy": 0.5963230866938829, | |
| "epoch": 1.3756613756613756, | |
| "grad_norm": 1.296875, | |
| "learning_rate": 1.940147464327637e-05, | |
| "loss": 0.5983511924743652, | |
| "mean_token_accuracy": 0.832802091538906, | |
| "num_tokens": 18553413.0, | |
| "step": 260 | |
| }, | |
| { | |
| "entropy": 0.5813015405088663, | |
| "epoch": 1.4285714285714286, | |
| "grad_norm": 1.28125, | |
| "learning_rate": 1.9341725584921712e-05, | |
| "loss": 0.5832551956176758, | |
| "mean_token_accuracy": 0.8360917493700981, | |
| "num_tokens": 19270191.0, | |
| "step": 270 | |
| }, | |
| { | |
| "entropy": 0.5801753208041192, | |
| "epoch": 1.4814814814814814, | |
| "grad_norm": 1.3046875, | |
| "learning_rate": 1.9279235472709554e-05, | |
| "loss": 0.5805642127990722, | |
| "mean_token_accuracy": 0.8362542942166329, | |
| "num_tokens": 19976552.0, | |
| "step": 280 | |
| }, | |
| { | |
| "entropy": 0.5879705954343081, | |
| "epoch": 1.5343915343915344, | |
| "grad_norm": 1.34375, | |
| "learning_rate": 1.92140226425203e-05, | |
| "loss": 0.5905383110046387, | |
| "mean_token_accuracy": 0.8341313540935517, | |
| "num_tokens": 20676613.0, | |
| "step": 290 | |
| }, | |
| { | |
| "entropy": 0.5889205444604159, | |
| "epoch": 1.5873015873015874, | |
| "grad_norm": 1.2578125, | |
| "learning_rate": 1.914610622913566e-05, | |
| "loss": 0.5913270950317383, | |
| "mean_token_accuracy": 0.8349448375403881, | |
| "num_tokens": 21385978.0, | |
| "step": 300 | |
| }, | |
| { | |
| "entropy": 0.5768780928105116, | |
| "epoch": 1.6402116402116402, | |
| "grad_norm": 1.234375, | |
| "learning_rate": 1.9075506160624068e-05, | |
| "loss": 0.5772612571716309, | |
| "mean_token_accuracy": 0.8369500823318958, | |
| "num_tokens": 22094336.0, | |
| "step": 310 | |
| }, | |
| { | |
| "entropy": 0.5735550723969937, | |
| "epoch": 1.693121693121693, | |
| "grad_norm": 1.3203125, | |
| "learning_rate": 1.900224315249343e-05, | |
| "loss": 0.5721980094909668, | |
| "mean_token_accuracy": 0.8380511656403542, | |
| "num_tokens": 22798906.0, | |
| "step": 320 | |
| }, | |
| { | |
| "entropy": 0.57716367803514, | |
| "epoch": 1.746031746031746, | |
| "grad_norm": 1.2109375, | |
| "learning_rate": 1.8926338701612738e-05, | |
| "loss": 0.5769223690032959, | |
| "mean_token_accuracy": 0.8371222764253616, | |
| "num_tokens": 23511239.0, | |
| "step": 330 | |
| }, | |
| { | |
| "entropy": 0.582606166601181, | |
| "epoch": 1.798941798941799, | |
| "grad_norm": 1.3671875, | |
| "learning_rate": 1.884781507990445e-05, | |
| "loss": 0.5855788230895996, | |
| "mean_token_accuracy": 0.8356470488011837, | |
| "num_tokens": 24231185.0, | |
| "step": 340 | |
| }, | |
| { | |
| "entropy": 0.5729806918650866, | |
| "epoch": 1.8518518518518519, | |
| "grad_norm": 1.21875, | |
| "learning_rate": 1.8766695327809463e-05, | |
| "loss": 0.5730391502380371, | |
| "mean_token_accuracy": 0.8385063141584397, | |
| "num_tokens": 24944285.0, | |
| "step": 350 | |
| }, | |
| { | |
| "entropy": 0.5666072227060794, | |
| "epoch": 1.9047619047619047, | |
| "grad_norm": 1.2109375, | |
| "learning_rate": 1.8683003247526567e-05, | |
| "loss": 0.5674479007720947, | |
| "mean_token_accuracy": 0.8392404697835445, | |
| "num_tokens": 25670441.0, | |
| "step": 360 | |
| }, | |
| { | |
| "entropy": 0.5809141755104065, | |
| "epoch": 1.9576719576719577, | |
| "grad_norm": 1.2890625, | |
| "learning_rate": 1.8596763396028384e-05, | |
| "loss": 0.5828475952148438, | |
| "mean_token_accuracy": 0.8360860221087932, | |
| "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 | |
| } | |