HuggingFaceH4/ultrachat_200k
Viewer • Updated • 515k • 67.1k • 758
How to use ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs5 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_epochs5")
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_epochs5")
model = AutoModelForCausalLM.from_pretrained("ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs5", 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_epochs5 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs5"
# 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_epochs5",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs5
How to use ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs5 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_epochs5" \
--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_epochs5",
"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_epochs5" \
--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_epochs5",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs5 with Docker Model Runner:
docker model run hf.co/ondevicellm/tinyllama_moe_sft_ultrachat200k_v2_epochs5
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.3359 | 0.09 | 100 | 1.3129 |
| 1.2425 | 0.18 | 200 | 1.2363 |
| 1.2079 | 0.26 | 300 | 1.2083 |
| 1.1849 | 0.35 | 400 | 1.1910 |
| 1.1545 | 0.44 | 500 | 1.1786 |
| 1.174 | 0.53 | 600 | 1.1690 |
| 1.1609 | 0.61 | 700 | 1.1610 |
| 1.1449 | 0.7 | 800 | 1.1543 |
| 1.1406 | 0.79 | 900 | 1.1485 |
| 1.1241 | 0.88 | 1000 | 1.1432 |
| 1.1477 | 0.96 | 1100 | 1.1385 |
| 1.0644 | 1.05 | 1200 | 1.1382 |
| 1.067 | 1.14 | 1300 | 1.1359 |
| 1.0791 | 1.23 | 1400 | 1.1332 |
| 1.0702 | 1.31 | 1500 | 1.1304 |
| 1.0741 | 1.4 | 1600 | 1.1277 |
| 1.0701 | 1.49 | 1700 | 1.1251 |
| 1.0529 | 1.58 | 1800 | 1.1225 |
| 1.072 | 1.66 | 1900 | 1.1199 |
| 1.0759 | 1.75 | 2000 | 1.1178 |
| 1.0618 | 1.84 | 2100 | 1.1152 |
| 1.0359 | 1.93 | 2200 | 1.1134 |
| 0.9918 | 2.01 | 2300 | 1.1195 |
| 1.002 | 2.1 | 2400 | 1.1205 |
| 0.993 | 2.19 | 2500 | 1.1194 |
| 0.9872 | 2.28 | 2600 | 1.1184 |
| 0.9849 | 2.37 | 2700 | 1.1172 |
| 0.9924 | 2.45 | 2800 | 1.1156 |
| 0.9971 | 2.54 | 2900 | 1.1145 |
| 0.9786 | 2.63 | 3000 | 1.1130 |
| 0.9923 | 2.72 | 3100 | 1.1122 |
| 0.9888 | 2.8 | 3200 | 1.1106 |
| 0.9826 | 2.89 | 3300 | 1.1091 |
| 0.9997 | 2.98 | 3400 | 1.1090 |
| 0.9267 | 3.07 | 3500 | 1.1219 |
| 0.9465 | 3.15 | 3600 | 1.1225 |
| 0.9255 | 3.24 | 3700 | 1.1221 |
| 0.9532 | 3.33 | 3800 | 1.1214 |
| 0.9372 | 3.42 | 3900 | 1.1215 |
| 0.9206 | 3.5 | 4000 | 1.1213 |
| 0.9394 | 3.59 | 4100 | 1.1207 |
| 0.9367 | 3.68 | 4200 | 1.1195 |
| 0.9245 | 3.77 | 4300 | 1.1191 |
| 0.9386 | 3.85 | 4400 | 1.1187 |
| 0.9209 | 3.94 | 4500 | 1.1187 |
| 0.9028 | 4.03 | 4600 | 1.1261 |
| 0.9087 | 4.12 | 4700 | 1.1278 |
| 0.9114 | 4.2 | 4800 | 1.1277 |
| 0.8854 | 4.29 | 4900 | 1.1280 |
| 0.902 | 4.38 | 5000 | 1.1278 |
| 0.9038 | 4.47 | 5100 | 1.1280 |
| 0.8935 | 4.56 | 5200 | 1.1280 |
| 0.9053 | 4.64 | 5300 | 1.1280 |
| 0.9091 | 4.73 | 5400 | 1.1278 |
| 0.8968 | 4.82 | 5500 | 1.1279 |
| 0.9196 | 4.91 | 5600 | 1.1279 |
| 0.9129 | 4.99 | 5700 | 1.1279 |