trollek/Danoia-v02
Viewer • Updated • 21.3k • 124
How to use trollek/Llama-3.2-3B-Danoia with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="trollek/Llama-3.2-3B-Danoia")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("trollek/Llama-3.2-3B-Danoia")
model = AutoModelForCausalLM.from_pretrained("trollek/Llama-3.2-3B-Danoia")
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 trollek/Llama-3.2-3B-Danoia with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "trollek/Llama-3.2-3B-Danoia"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "trollek/Llama-3.2-3B-Danoia",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/trollek/Llama-3.2-3B-Danoia
How to use trollek/Llama-3.2-3B-Danoia with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "trollek/Llama-3.2-3B-Danoia" \
--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": "trollek/Llama-3.2-3B-Danoia",
"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 "trollek/Llama-3.2-3B-Danoia" \
--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": "trollek/Llama-3.2-3B-Danoia",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use trollek/Llama-3.2-3B-Danoia with Docker Model Runner:
docker model run hf.co/trollek/Llama-3.2-3B-Danoia
Der er ikke meget at sige andet end at den kan dansk.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.0895 | 0.2103 | 500 | 1.0488 |
| 1.0893 | 0.4205 | 1000 | 0.9952 |
| 0.864 | 0.6308 | 1500 | 0.9645 |
| 0.9665 | 0.8411 | 2000 | 0.9406 |
| 0.9387 | 1.0514 | 2500 | 0.9242 |
| 0.7996 | 1.2617 | 3000 | 0.9126 |
| 0.7904 | 1.4720 | 3500 | 0.9005 |
| 0.9745 | 1.6822 | 4000 | 0.8926 |
| 1.0152 | 1.8925 | 4500 | 0.8859 |
| 0.7676 | 2.1028 | 5000 | 0.8821 |
| 0.8127 | 2.3131 | 5500 | 0.8791 |
| 0.9498 | 2.5234 | 6000 | 0.8770 |
| 0.795 | 2.7336 | 6500 | 0.8758 |
| 0.8029 | 2.9439 | 7000 | 0.8758 |
Base model
meta-llama/Llama-3.2-3B-Instruct