HuggingFaceH4/ultrachat_200k
Viewer • Updated • 515k • 90.2k • 875
How to use ondevicellm/tinyllama_moe_sft_ultrachat-slimorca with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ondevicellm/tinyllama_moe_sft_ultrachat-slimorca")
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_ultrachat-slimorca")
model = AutoModelForCausalLM.from_pretrained("ondevicellm/tinyllama_moe_sft_ultrachat-slimorca", 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_ultrachat-slimorca with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ondevicellm/tinyllama_moe_sft_ultrachat-slimorca"
# 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_ultrachat-slimorca",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ondevicellm/tinyllama_moe_sft_ultrachat-slimorca
How to use ondevicellm/tinyllama_moe_sft_ultrachat-slimorca with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ondevicellm/tinyllama_moe_sft_ultrachat-slimorca" \
--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_ultrachat-slimorca",
"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_ultrachat-slimorca" \
--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_ultrachat-slimorca",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ondevicellm/tinyllama_moe_sft_ultrachat-slimorca with Docker Model Runner:
docker model run hf.co/ondevicellm/tinyllama_moe_sft_ultrachat-slimorca
This model is a fine-tuned version of ondevicellm/tinyllama_moe on the HuggingFaceH4/ultrachat_200k and the ondevicellm/SlimOrca datasets. 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.4601 | 0.05 | 100 | 1.3361 |
| 1.3324 | 0.1 | 200 | 1.2566 |
| 1.2946 | 0.14 | 300 | 1.2279 |
| 1.2767 | 0.19 | 400 | 1.2111 |
| 1.2298 | 0.24 | 500 | 1.1995 |
| 1.2247 | 0.29 | 600 | 1.1902 |
| 1.2208 | 0.34 | 700 | 1.1833 |
| 1.2375 | 0.39 | 800 | 1.1775 |
| 1.2038 | 0.43 | 900 | 1.1726 |
| 1.1926 | 0.48 | 1000 | 1.1683 |
| 1.1933 | 0.53 | 1100 | 1.1649 |
| 1.1893 | 0.58 | 1200 | 1.1618 |
| 1.2029 | 0.63 | 1300 | 1.1593 |
| 1.2201 | 0.68 | 1400 | 1.1572 |
| 1.1741 | 0.72 | 1500 | 1.1557 |
| 1.1813 | 0.77 | 1600 | 1.1545 |
| 1.1668 | 0.82 | 1700 | 1.1536 |
| 1.1495 | 0.87 | 1800 | 1.1530 |
| 1.1595 | 0.92 | 1900 | 1.1527 |
| 1.1607 | 0.97 | 2000 | 1.1526 |
Base model
ondevicellm/tinyllama_moe