tanliboy/OpenHermes-2.5-reformat
Viewer • Updated • 1M • 12
How to use tanliboy/llama-3.2-3b-sft-2 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-2")
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-2")
model = AutoModelForCausalLM.from_pretrained("tanliboy/llama-3.2-3b-sft-2")
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-2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tanliboy/llama-3.2-3b-sft-2"
# 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-2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/tanliboy/llama-3.2-3b-sft-2
How to use tanliboy/llama-3.2-3b-sft-2 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-2" \
--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-2",
"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-2" \
--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-2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use tanliboy/llama-3.2-3b-sft-2 with Docker Model Runner:
docker model run hf.co/tanliboy/llama-3.2-3b-sft-2
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.7792 | 0.0673 | 500 | 0.7726 |
| 0.7496 | 0.1345 | 1000 | 0.7444 |
| 0.7243 | 0.2018 | 1500 | 0.7296 |
| 0.7178 | 0.2691 | 2000 | 0.7197 |
| 0.7077 | 0.3363 | 2500 | 0.7127 |
| 0.6992 | 0.4036 | 3000 | 0.7066 |
| 0.6992 | 0.4708 | 3500 | 0.7012 |
| 0.6945 | 0.5381 | 4000 | 0.6965 |
| 0.6879 | 0.6054 | 4500 | 0.6920 |
| 0.6901 | 0.6726 | 5000 | 0.6879 |
| 0.6759 | 0.7399 | 5500 | 0.6844 |
| 0.6752 | 0.8072 | 6000 | 0.6812 |
| 0.6826 | 0.8744 | 6500 | 0.6783 |
| 0.6804 | 0.9417 | 7000 | 0.6758 |
| 0.6131 | 1.0089 | 7500 | 0.6764 |
| 0.6012 | 1.0762 | 8000 | 0.6758 |
| 0.6136 | 1.1435 | 8500 | 0.6751 |
| 0.6127 | 1.2107 | 9000 | 0.6747 |
| 0.6076 | 1.2780 | 9500 | 0.6745 |
| 0.6033 | 1.3453 | 10000 | 0.6744 |