timarni/MNLP_M3_mcqa_dataset
Viewer • Updated • 687k • 168
How to use timarni/dpo_it_bal with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="timarni/dpo_it_bal")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("timarni/dpo_it_bal")
model = AutoModelForMultimodalLM.from_pretrained("timarni/dpo_it_bal")
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 timarni/dpo_it_bal with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "timarni/dpo_it_bal"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "timarni/dpo_it_bal",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/timarni/dpo_it_bal
How to use timarni/dpo_it_bal with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "timarni/dpo_it_bal" \
--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": "timarni/dpo_it_bal",
"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 "timarni/dpo_it_bal" \
--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": "timarni/dpo_it_bal",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use timarni/dpo_it_bal with Docker Model Runner:
docker model run hf.co/timarni/dpo_it_bal
axolotl version: 0.9.2
base_model: timarni/qwen3_dpo
# Automatically upload checkpoint and final model to HF
# hub_model_id: username/custom_model_name
plugins:
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
strict: false
chat_template: qwen3
datasets:
- path: timarni/MNLP_M3_mcqa_dataset # timarni/MNLP_intstruction_tuning
name: stem_instruction_tuning_balanced_mini
type: alpaca
split: train
shuffle_merged_datasets: true
val_set_size: 0.1
output_dir: ./outputs/dpo_it_bal
dataset_prepared_path: last_run_prepared
sequence_len: 2048 #2048
sample_packing: true # was true -> need to check if it actually learns on the samples or not (better understand te hyperparam and event. install axolotl to debug)
eval_sample_packing: true
pad_to_sequence_len: true
train_on_inputs: false # NEW
# group_by_length: false NEW?
# To be sure that no LORA is done
adapter: null
lora: false
merge_lora: false
wandb_project: mnlp_project
wandb_entity: tim-arni
wandb_watch:
wandb_name: wiki_it_bal
wandb_log_model:
gradient_accumulation_steps: 2
micro_batch_size: 1 # 2
num_epochs: 6
optimizer: adamw_torch
lr_scheduler: cosine
learning_rate: 5e-6 # 0.00005
cosine_min_lr_ratio: 0.1
warmup_ratio: 0.05
weight_decay: 0.01
bf16: auto
tf32: true
gradient_checkpointing: offload
gradient_checkpointing_kwargs:
use_reentrant: false
resume_from_checkpoint:
logging_steps: 1
gradient_clipping: 1.0 # or max_grad_norm?
flash_attention: true
evals_per_epoch: 4
saves_per_epoch: 2
save_total_limit: 25
special_tokens:
This model is a fine-tuned version of timarni/qwen3_dpo on the timarni/MNLP_M3_mcqa_dataset 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 |
|---|---|---|---|
| 2.0143 | 0.0122 | 1 | 1.8038 |
| 0.988 | 0.2561 | 21 | 0.9164 |
| 0.2107 | 0.5122 | 42 | 0.1900 |
| 0.1751 | 0.7683 | 63 | 0.1814 |
| 0.1691 | 1.0244 | 84 | 0.1785 |
| 0.1521 | 1.2805 | 105 | 0.1759 |
| 0.1458 | 1.5366 | 126 | 0.1759 |
| 0.1822 | 1.7927 | 147 | 0.1749 |
| 0.153 | 2.0488 | 168 | 0.1736 |
| 0.1603 | 2.3049 | 189 | 0.1739 |
| 0.1474 | 2.5610 | 210 | 0.1751 |
| 0.2087 | 2.8171 | 231 | 0.1738 |
| 0.1599 | 3.0732 | 252 | 0.1732 |
| 0.1411 | 3.3293 | 273 | 0.1734 |
| 0.2014 | 3.5854 | 294 | 0.1744 |
| 0.1507 | 3.8415 | 315 | 0.1735 |
| 0.1684 | 4.0976 | 336 | 0.1735 |
| 0.1547 | 4.3537 | 357 | 0.1731 |
| 0.1469 | 4.6098 | 378 | 0.1738 |
| 0.155 | 4.8659 | 399 | 0.1736 |
| 0.162 | 5.1220 | 420 | 0.1735 |
| 0.1274 | 5.3780 | 441 | 0.1732 |
| 0.1397 | 5.6341 | 462 | 0.1736 |
| 0.1333 | 5.8902 | 483 | 0.1734 |
docker model run hf.co/timarni/dpo_it_bal