jondurbin/airoboros-3.2
Viewer • Updated • 58.7k • 528 • 49
How to use trollek/danube2-1.8b-airoboros-3.2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="trollek/danube2-1.8b-airoboros-3.2")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("trollek/danube2-1.8b-airoboros-3.2")
model = AutoModelForCausalLM.from_pretrained("trollek/danube2-1.8b-airoboros-3.2", 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 trollek/danube2-1.8b-airoboros-3.2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "trollek/danube2-1.8b-airoboros-3.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": "trollek/danube2-1.8b-airoboros-3.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/trollek/danube2-1.8b-airoboros-3.2
How to use trollek/danube2-1.8b-airoboros-3.2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "trollek/danube2-1.8b-airoboros-3.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": "trollek/danube2-1.8b-airoboros-3.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 "trollek/danube2-1.8b-airoboros-3.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": "trollek/danube2-1.8b-airoboros-3.2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use trollek/danube2-1.8b-airoboros-3.2 with Docker Model Runner:
docker model run hf.co/trollek/danube2-1.8b-airoboros-3.2
This is a BAdam fine-tuned and LoRA+ danube2 base model. It uses the ChatML template and was trained on the Airoboros-3.2 (CC BY 4.0) dataset from jondurbin.
Thank you mradermacher!
<|im_start|>user
{{instruction}}<|im_end|>
<|im_start|>assistant
{{response}}<|im_end|>
System: You are a helpful assistant.
### model
model_name_or_path: danube2-base-chatml
### method
stage: sft
do_train: true
finetuning_type: full
use_badam: true
badam_switch_mode: ascending
badam_switch_interval: 50
badam_verbose: 1
badam_start_block: 13
badam_mask_mode: scatter
seed: 314
### dataset
dataset: airoboros32
template: hermes_chatml
cutoff_len: 8192
overwrite_cache: false
preprocessing_num_workers: 12
### output
output_dir: airoboros32-chatml-badam
logging_steps: 5
save_steps: 1
save_strategy: epoch
plot_loss: true
overwrite_output_dir: false
### train
per_device_train_batch_size: 2
gradient_accumulation_steps: 8
learning_rate: 0.00001
num_train_epochs: 2
lr_scheduler_type: cosine
warmup_ratio: 0.01
pure_bf16: true
flash_attn: fa2
### eval
val_size: 0.01
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 1000
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.9124 | 0.2753 | 1000 | 0.9466 |
| 0.8072 | 0.5506 | 2000 | 0.9149 |
| 0.9017 | 0.8258 | 3000 | 0.8982 |
| 0.8883 | 1.1011 | 4000 | 0.8844 |
| 0.8405 | 1.3764 | 5000 | 0.8786 |
| 0.864 | 1.6517 | 6000 | 0.8754 |
| 0.7758 | 1.9270 | 7000 | 0.8752 |
System: None
### model
model_name_or_path: airoboros32-chatml-badam
### method
stage: sft
do_train: true
finetuning_type: lora
lora_target: all
loraplus_lr_ratio: 16.0
lora_rank: 8
lora_alpha: 16
use_unsloth: true
quantization_bit: 4
upcast_layernorm: true
seed: 314
### dataset
dataset: airoboros32
template: hermes_chatml
cutoff_len: 8192
overwrite_cache: false
preprocessing_num_workers: 12
### output
output_dir: airoboros32-chatml-badam/loraplus
logging_steps: 1
save_steps: 1
save_strategy: epoch
plot_loss: true
overwrite_output_dir: false
### train
per_device_train_batch_size: 4
gradient_accumulation_steps: 4
learning_rate: 0.0001
num_train_epochs: 2.0
lr_scheduler_type: cosine
warmup_ratio: 0.01
bf16: true
flash_attn: fa2
### eval
val_size: 0.02
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 1000
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.9691 | 0.2781 | 1000 | 0.8704 |
| 0.7387 | 0.5562 | 2000 | 0.8443 |
| 0.6769 | 0.8343 | 3000 | 0.8250 |
| 0.5156 | 1.1123 | 4000 | 0.8134 |
| 0.4142 | 1.3904 | 5000 | 0.8029 |
| 0.6328 | 1.6685 | 6000 | 0.7953 |
| 0.872 | 1.9466 | 7000 | 0.7927 |