migtissera/Synthia-v1.3
Viewer • Updated • 119k • 295 • 98
How to use LTC-AI-Labs/L2-7b-Hermes-Synthia with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="LTC-AI-Labs/L2-7b-Hermes-Synthia")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("LTC-AI-Labs/L2-7b-Hermes-Synthia")
model = AutoModelForCausalLM.from_pretrained("LTC-AI-Labs/L2-7b-Hermes-Synthia")
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 LTC-AI-Labs/L2-7b-Hermes-Synthia with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "LTC-AI-Labs/L2-7b-Hermes-Synthia"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "LTC-AI-Labs/L2-7b-Hermes-Synthia",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/LTC-AI-Labs/L2-7b-Hermes-Synthia
How to use LTC-AI-Labs/L2-7b-Hermes-Synthia with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "LTC-AI-Labs/L2-7b-Hermes-Synthia" \
--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": "LTC-AI-Labs/L2-7b-Hermes-Synthia",
"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 "LTC-AI-Labs/L2-7b-Hermes-Synthia" \
--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": "LTC-AI-Labs/L2-7b-Hermes-Synthia",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use LTC-AI-Labs/L2-7b-Hermes-Synthia with Docker Model Runner:
docker model run hf.co/LTC-AI-Labs/L2-7b-Hermes-Synthia
Fine-tuned the synthia dataset on the hermes2 7b model
In my opinion it's probably the best model I fine-tuned in-terms of role-playing (tested on LavernAI)
Future plans:
I'll probably do more test in other areas
Will add other languages (Potentially japanese and chinese)
Finetune it on mistral models?
Detailed results can be found here
| Metric | Value |
|---|---|
| Avg. | 52.21 |
| AI2 Reasoning Challenge (25-Shot) | 51.02 |
| HellaSwag (10-Shot) | 79.12 |
| MMLU (5-Shot) | 47.88 |
| TruthfulQA (0-shot) | 46.77 |
| Winogrande (5-shot) | 74.51 |
| GSM8k (5-shot) | 13.95 |