HuggingFaceH4/ultrachat_200k
Viewer • Updated • 515k • 67.1k • 758
How to use ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3")
model = AutoModelForCausalLM.from_pretrained("ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3", device_map="auto")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3
How to use ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3 with Docker Model Runner:
docker model run hf.co/ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs3
This model is a fine-tuned version of ondevicellm/tinyllama_moe on the HuggingFaceH4/ultrachat_200k dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.336 | 0.09 | 100 | 1.3129 |
| 1.2424 | 0.18 | 200 | 1.2363 |
| 1.2079 | 0.26 | 300 | 1.2084 |
| 1.185 | 0.35 | 400 | 1.1911 |
| 1.1546 | 0.44 | 500 | 1.1787 |
| 1.1741 | 0.53 | 600 | 1.1692 |
| 1.1612 | 0.61 | 700 | 1.1613 |
| 1.1453 | 0.7 | 800 | 1.1547 |
| 1.141 | 0.79 | 900 | 1.1489 |
| 1.1247 | 0.88 | 1000 | 1.1438 |
| 1.1485 | 0.96 | 1100 | 1.1392 |
| 1.067 | 1.05 | 1200 | 1.1387 |
| 1.0694 | 1.14 | 1300 | 1.1368 |
| 1.0814 | 1.23 | 1400 | 1.1341 |
| 1.0727 | 1.31 | 1500 | 1.1316 |
| 1.0769 | 1.4 | 1600 | 1.1292 |
| 1.0728 | 1.49 | 1700 | 1.1270 |
| 1.0558 | 1.58 | 1800 | 1.1247 |
| 1.0753 | 1.66 | 1900 | 1.1229 |
| 1.0799 | 1.75 | 2000 | 1.1209 |
| 1.066 | 1.84 | 2100 | 1.1192 |
| 1.0406 | 1.93 | 2200 | 1.1178 |
| 1.0193 | 2.01 | 2300 | 1.1222 |
| 1.0276 | 2.1 | 2400 | 1.1220 |
| 1.0171 | 2.19 | 2500 | 1.1215 |
| 1.0112 | 2.28 | 2600 | 1.1211 |
| 1.0087 | 2.37 | 2700 | 1.1207 |
| 1.0158 | 2.45 | 2800 | 1.1204 |
| 1.0219 | 2.54 | 2900 | 1.1199 |
| 1.0024 | 2.63 | 3000 | 1.1197 |
| 1.019 | 2.72 | 3100 | 1.1197 |
| 1.0135 | 2.8 | 3200 | 1.1194 |
| 1.0094 | 2.89 | 3300 | 1.1194 |
| 1.0284 | 2.98 | 3400 | 1.1194 |