Instructions to use kunjcr2/gemma3_finetune with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use kunjcr2/gemma3_finetune with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-3-270m") model = PeftModel.from_pretrained(base_model, "kunjcr2/gemma3_finetune") - Transformers
How to use kunjcr2/gemma3_finetune with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kunjcr2/gemma3_finetune")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kunjcr2/gemma3_finetune", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kunjcr2/gemma3_finetune with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kunjcr2/gemma3_finetune" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kunjcr2/gemma3_finetune", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kunjcr2/gemma3_finetune
- SGLang
How to use kunjcr2/gemma3_finetune 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 "kunjcr2/gemma3_finetune" \ --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": "kunjcr2/gemma3_finetune", "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 "kunjcr2/gemma3_finetune" \ --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": "kunjcr2/gemma3_finetune", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kunjcr2/gemma3_finetune with Docker Model Runner:
docker model run hf.co/kunjcr2/gemma3_finetune
| { | |
| "best_global_step": 500, | |
| "best_metric": 1.4127447605133057, | |
| "best_model_checkpoint": "./gemma3_finetune/checkpoint-500", | |
| "epoch": 3.0, | |
| "eval_steps": 100, | |
| "global_step": 558, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.10774410774410774, | |
| "grad_norm": 1.6064836978912354, | |
| "learning_rate": 1.6964285714285715e-05, | |
| "loss": 2.1903, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.21548821548821548, | |
| "grad_norm": 0.9092773199081421, | |
| "learning_rate": 3.4821428571428574e-05, | |
| "loss": 1.8574, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.32323232323232326, | |
| "grad_norm": 0.7761135101318359, | |
| "learning_rate": 4.999559412596081e-05, | |
| "loss": 1.6196, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.43097643097643096, | |
| "grad_norm": 0.6488329768180847, | |
| "learning_rate": 4.974147171991723e-05, | |
| "loss": 1.5175, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.5387205387205387, | |
| "grad_norm": 0.6469504237174988, | |
| "learning_rate": 4.910026034587031e-05, | |
| "loss": 1.4836, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.5387205387205387, | |
| "eval_loss": 1.5036908388137817, | |
| "eval_runtime": 14.2727, | |
| "eval_samples_per_second": 87.65, | |
| "eval_steps_per_second": 11.0, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.6464646464646465, | |
| "grad_norm": 0.7555330395698547, | |
| "learning_rate": 4.808199197976157e-05, | |
| "loss": 1.4586, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.7542087542087542, | |
| "grad_norm": 0.7224211096763611, | |
| "learning_rate": 4.670259778589074e-05, | |
| "loss": 1.4615, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.8619528619528619, | |
| "grad_norm": 0.7545987963676453, | |
| "learning_rate": 4.498365886828511e-05, | |
| "loss": 1.4429, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.9696969696969697, | |
| "grad_norm": 0.6888415217399597, | |
| "learning_rate": 4.295206862678802e-05, | |
| "loss": 1.4457, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 1.0754208754208754, | |
| "grad_norm": 0.7888140678405762, | |
| "learning_rate": 4.063961200042368e-05, | |
| "loss": 1.4164, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.0754208754208754, | |
| "eval_loss": 1.450657606124878, | |
| "eval_runtime": 14.314, | |
| "eval_samples_per_second": 87.397, | |
| "eval_steps_per_second": 10.968, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.183164983164983, | |
| "grad_norm": 0.7697953581809998, | |
| "learning_rate": 3.8082468180922686e-05, | |
| "loss": 1.4052, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 1.290909090909091, | |
| "grad_norm": 0.7794164419174194, | |
| "learning_rate": 3.532064457662889e-05, | |
| "loss": 1.4016, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 1.3986531986531987, | |
| "grad_norm": 0.7602345943450928, | |
| "learning_rate": 3.239735088262007e-05, | |
| "loss": 1.3902, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 1.5063973063973064, | |
| "grad_norm": 0.7201767563819885, | |
| "learning_rate": 2.935832304993402e-05, | |
| "loss": 1.3978, | |
| "step": 280 | |
| }, | |
| { | |
| "epoch": 1.614141414141414, | |
| "grad_norm": 0.7935007214546204, | |
| "learning_rate": 2.625110773063754e-05, | |
| "loss": 1.3875, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 1.614141414141414, | |
| "eval_loss": 1.4275208711624146, | |
| "eval_runtime": 14.2116, | |
| "eval_samples_per_second": 88.027, | |
| "eval_steps_per_second": 11.047, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 1.7218855218855218, | |
| "grad_norm": 0.746303379535675, | |
| "learning_rate": 2.312431839384543e-05, | |
| "loss": 1.393, | |
| "step": 320 | |
| }, | |
| { | |
| "epoch": 1.8296296296296295, | |
| "grad_norm": 0.7554110884666443, | |
| "learning_rate": 2.0026874751013972e-05, | |
| "loss": 1.3853, | |
| "step": 340 | |
| }, | |
| { | |
| "epoch": 1.9373737373737374, | |
| "grad_norm": 0.735357403755188, | |
| "learning_rate": 1.7007237389966146e-05, | |
| "loss": 1.3835, | |
| "step": 360 | |
| }, | |
| { | |
| "epoch": 2.043097643097643, | |
| "grad_norm": 0.7572635412216187, | |
| "learning_rate": 1.4112649592066293e-05, | |
| "loss": 1.369, | |
| "step": 380 | |
| }, | |
| { | |
| "epoch": 2.1508417508417508, | |
| "grad_norm": 0.7531948685646057, | |
| "learning_rate": 1.1388398194579725e-05, | |
| "loss": 1.3724, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.1508417508417508, | |
| "eval_loss": 1.4167424440383911, | |
| "eval_runtime": 14.2716, | |
| "eval_samples_per_second": 87.657, | |
| "eval_steps_per_second": 11.001, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.2585858585858585, | |
| "grad_norm": 0.7567663192749023, | |
| "learning_rate": 8.877105062283609e-06, | |
| "loss": 1.3674, | |
| "step": 420 | |
| }, | |
| { | |
| "epoch": 2.366329966329966, | |
| "grad_norm": 0.7656159400939941, | |
| "learning_rate": 6.618060253503472e-06, | |
| "loss": 1.3686, | |
| "step": 440 | |
| }, | |
| { | |
| "epoch": 2.474074074074074, | |
| "grad_norm": 0.7571391463279724, | |
| "learning_rate": 4.646607313425419e-06, | |
| "loss": 1.3617, | |
| "step": 460 | |
| }, | |
| { | |
| "epoch": 2.581818181818182, | |
| "grad_norm": 0.7939226627349854, | |
| "learning_rate": 2.9935903119851757e-06, | |
| "loss": 1.3648, | |
| "step": 480 | |
| }, | |
| { | |
| "epoch": 2.6895622895622897, | |
| "grad_norm": 0.7923122048377991, | |
| "learning_rate": 1.6848712776191767e-06, | |
| "loss": 1.3694, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 2.6895622895622897, | |
| "eval_loss": 1.4127447605133057, | |
| "eval_runtime": 14.3897, | |
| "eval_samples_per_second": 86.937, | |
| "eval_steps_per_second": 10.911, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 2.7973063973063974, | |
| "grad_norm": 0.7516689896583557, | |
| "learning_rate": 7.409255767952538e-07, | |
| "loss": 1.3562, | |
| "step": 520 | |
| }, | |
| { | |
| "epoch": 2.905050505050505, | |
| "grad_norm": 0.751866340637207, | |
| "learning_rate": 1.7652156975161982e-07, | |
| "loss": 1.3503, | |
| "step": 540 | |
| } | |
| ], | |
| "logging_steps": 20, | |
| "max_steps": 558, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "EarlyStoppingCallback": { | |
| "args": { | |
| "early_stopping_patience": 3, | |
| "early_stopping_threshold": 0.0 | |
| }, | |
| "attributes": { | |
| "early_stopping_patience_counter": 0 | |
| } | |
| }, | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.181275398144e+16, | |
| "train_batch_size": 16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |