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
Add trainer model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
model_name: sft_gemma2_2b_code_layerdrop_p010
|
| 4 |
+
tags:
|
| 5 |
+
- generated_from_trainer
|
| 6 |
+
- trl
|
| 7 |
+
- hf_jobs
|
| 8 |
+
- sft
|
| 9 |
+
licence: license
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Model Card for sft_gemma2_2b_code_layerdrop_p010
|
| 13 |
+
|
| 14 |
+
This model is a fine-tuned version of [None](https://huggingface.co/None).
|
| 15 |
+
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 16 |
+
|
| 17 |
+
## Quick start
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from transformers import pipeline
|
| 21 |
+
|
| 22 |
+
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 23 |
+
generator = pipeline("text-generation", model="None", device="cuda")
|
| 24 |
+
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 25 |
+
print(output["generated_text"])
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## Training procedure
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
This model was trained with SFT.
|
| 35 |
+
|
| 36 |
+
### Framework versions
|
| 37 |
+
|
| 38 |
+
- TRL: 1.13.0
|
| 39 |
+
- Transformers: 5.17.0
|
| 40 |
+
- Pytorch: 2.13.0
|
| 41 |
+
- Datasets: 5.0.1
|
| 42 |
+
- Tokenizers: 0.23.2
|
| 43 |
+
|
| 44 |
+
## Citations
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
Cite TRL as:
|
| 49 |
+
|
| 50 |
+
```bibtex
|
| 51 |
+
@software{vonwerra2020trl,
|
| 52 |
+
title = {{TRL: Transformers Reinforcement Learning}},
|
| 53 |
+
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
|
| 54 |
+
license = {Apache-2.0},
|
| 55 |
+
url = {https://github.com/huggingface/trl},
|
| 56 |
+
year = {2020}
|
| 57 |
+
}
|
| 58 |
+
```
|