HuggingFaceH4/ultrachat_200k
Viewer • Updated • 515k • 69.9k • 705
How to use pansophic/gemma-2b-sft-preview with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="pansophic/gemma-2b-sft-preview") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("pansophic/gemma-2b-sft-preview")
model = AutoModelForCausalLM.from_pretrained("pansophic/gemma-2b-sft-preview")How to use pansophic/gemma-2b-sft-preview with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "pansophic/gemma-2b-sft-preview"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "pansophic/gemma-2b-sft-preview",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/pansophic/gemma-2b-sft-preview
How to use pansophic/gemma-2b-sft-preview with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "pansophic/gemma-2b-sft-preview" \
--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": "pansophic/gemma-2b-sft-preview",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "pansophic/gemma-2b-sft-preview" \
--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": "pansophic/gemma-2b-sft-preview",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use pansophic/gemma-2b-sft-preview with Docker Model Runner:
docker model run hf.co/pansophic/gemma-2b-sft-preview
This is just a preview model. It is a finetuned gemma-2b with added chatml tokens.
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 54.63 |
| AI2 Reasoning Challenge (25-Shot) | 52.56 |
| HellaSwag (10-Shot) | 73.65 |
| MMLU (5-Shot) | 46.02 |
| TruthfulQA (0-shot) | 51.25 |
| Winogrande (5-shot) | 66.38 |
| GSM8k (5-shot) | 37.91 |
Base model
google/gemma-2b