argilla/distilabel-intel-orca-dpo-pairs
Viewer • Updated • 12.9k • 23.3k • 183
How to use gardner/TinyLlama-1.1B-DPO-Function-Calling-3T with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="gardner/TinyLlama-1.1B-DPO-Function-Calling-3T")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("gardner/TinyLlama-1.1B-DPO-Function-Calling-3T")
model = AutoModelForCausalLM.from_pretrained("gardner/TinyLlama-1.1B-DPO-Function-Calling-3T")
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 gardner/TinyLlama-1.1B-DPO-Function-Calling-3T with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "gardner/TinyLlama-1.1B-DPO-Function-Calling-3T"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "gardner/TinyLlama-1.1B-DPO-Function-Calling-3T",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/gardner/TinyLlama-1.1B-DPO-Function-Calling-3T
How to use gardner/TinyLlama-1.1B-DPO-Function-Calling-3T with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "gardner/TinyLlama-1.1B-DPO-Function-Calling-3T" \
--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": "gardner/TinyLlama-1.1B-DPO-Function-Calling-3T",
"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 "gardner/TinyLlama-1.1B-DPO-Function-Calling-3T" \
--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": "gardner/TinyLlama-1.1B-DPO-Function-Calling-3T",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use gardner/TinyLlama-1.1B-DPO-Function-Calling-3T with Docker Model Runner:
docker model run hf.co/gardner/TinyLlama-1.1B-DPO-Function-Calling-3T
This model is a DPO fine tune of gardner/TinyLlama-1.1B-SlimOrca-Function-Calling-3T which itself was trained on:
The model scores unusually high on GSM8K which indicates the glaive function calling dataset may introduce data contamination.
axolotl version: 0.4.0
base_model: gardner/TinyLlama-1.1B-SlimOrca-Function-Calling-3T
model_type: LlamaForCausalLM
tokenizer_type: LlamaTokenizer
chat_template: chatml
is_llama_derived_model: true
load_in_8bit: true
load_in_4bit: false
strict: false
rl: dpo
datasets:
- path: argilla/distilabel-intel-orca-dpo-pairs
split: train
type: chatml.gardner
dataset_prepared_path: ./dsprepare/argilla/distilabel-intel-orca-dpo-pairs
val_set_size: 0.05
output_dir: ./TinyLlama-1.1B-DPO-Function-Calling-3T
sequence_len: 4096
sample_packing: false
pad_to_sequence_len: false
adapter: lora
lora_model_dir:
lora_r: 256
lora_alpha: 128
lora_dropout: 0.05
lora_target_linear: true
lora_modules_to_save:
lora_fan_in_fan_out:
lora_target_modules:
- gate_proj
- down_proj
- up_proj
- q_proj
- v_proj
- k_proj
- o_proj
wandb_project: tinyllama
wandb_entity: gardner
wandb_name: tinyllama-distilabel-intel-orca-dpo-pairs
gradient_accumulation_steps: 1
micro_batch_size: 2
num_epochs: 3
optimizer: paged_adamw_8bit
adam_beta2: 0.95
adam_epsilion: 0.00001
lr_scheduler: linear
learning_rate: 1.414e-5
train_on_inputs: false
group_by_length: false
bf16: true
fp16: false
tf32: true
gradient_checkpointing: true
gradient_checkpoint_kwargs:
use_reentrant: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
warmup_steps: 10
eval_steps:
eval_table_size:
eval_table_max_new_tokens: 128
save_steps: 45
debug:
deepspeed:
weight_decay: 0.1
fsdp:
fsdp_config:
special_tokens:
save_safetensors: true
dataloader_num_workers: 16
dataloader_pin_memory: true
This model is a fine-tuned version of gardner/TinyLlama-1.1B-SlimOrca-Function-Calling-3T on the None dataset.
The following hyperparameters were used during training: