tanliboy/OpenHermes-2.5-reformat
Viewer • Updated • 1M • 51
How to use tanliboy/llama-3.2-3b-sft with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tanliboy/llama-3.2-3b-sft")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tanliboy/llama-3.2-3b-sft")
model = AutoModelForCausalLM.from_pretrained("tanliboy/llama-3.2-3b-sft")
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 tanliboy/llama-3.2-3b-sft with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tanliboy/llama-3.2-3b-sft"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tanliboy/llama-3.2-3b-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tanliboy/llama-3.2-3b-sft
How to use tanliboy/llama-3.2-3b-sft with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tanliboy/llama-3.2-3b-sft" \
--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": "tanliboy/llama-3.2-3b-sft",
"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 "tanliboy/llama-3.2-3b-sft" \
--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": "tanliboy/llama-3.2-3b-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tanliboy/llama-3.2-3b-sft with Docker Model Runner:
docker model run hf.co/tanliboy/llama-3.2-3b-sft
This model is a fine-tuned version of tanliboy/llama-3.2-3b on the tanliboy/OpenHermes-2.5-reformat 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 |
|---|---|---|---|
| 0.8741 | 0.0448 | 100 | 0.8600 |
| 0.8038 | 0.0897 | 200 | 0.8095 |
| 0.7937 | 0.1345 | 300 | 0.7789 |
| 0.7712 | 0.1794 | 400 | 0.7644 |
| 0.7393 | 0.2242 | 500 | 0.7565 |
| 0.7458 | 0.2691 | 600 | 0.7506 |
| 0.7694 | 0.3139 | 700 | 0.7458 |
| 0.713 | 0.3587 | 800 | 0.7422 |
| 0.7347 | 0.4036 | 900 | 0.7387 |
| 0.7243 | 0.4484 | 1000 | 0.7356 |
| 0.7161 | 0.4933 | 1100 | 0.7331 |
| 0.7247 | 0.5381 | 1200 | 0.7308 |
| 0.7477 | 0.5830 | 1300 | 0.7288 |
| 0.7429 | 0.6278 | 1400 | 0.7273 |
| 0.7317 | 0.6726 | 1500 | 0.7256 |
| 0.7226 | 0.7175 | 1600 | 0.7243 |
| 0.695 | 0.7623 | 1700 | 0.7234 |
| 0.7167 | 0.8072 | 1800 | 0.7226 |
| 0.686 | 0.8520 | 1900 | 0.7221 |
| 0.7214 | 0.8969 | 2000 | 0.7218 |
| 0.7358 | 0.9417 | 2100 | 0.7216 |
| 0.7259 | 0.9865 | 2200 | 0.7216 |