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
Commit History
-
Upload checkpoint-1701
Verified signature7c5674f -
Upload checkpoint-1512
Verified signature5be151d -
Upload checkpoint-1323
Verified signature7ff3dbe -
Upload checkpoint-1134
Verified signaturea194742 -
Upload checkpoint-945
Verified signature998a148 -
Upload checkpoint-756
Verified signature8baae3b -
Upload checkpoint-567
Verified signature3284ff5 -
Upload checkpoint-378
Verified signature9b2dfdf -
Upload checkpoint-189
Verified signature9f04038 -
Add trainer model card
Verified signature08b567a -
Upload final checkpoint
Verified signatureb972cb9 -
initial commit
Verified signature4a4b4f3