Rexhaif/wmt23-pairs-sft
Viewer • Updated • 270k • 10
How to use Rexhaif/Qwen3-4B-MTEval-SFT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Rexhaif/Qwen3-4B-MTEval-SFT")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Rexhaif/Qwen3-4B-MTEval-SFT")
model = AutoModelForCausalLM.from_pretrained("Rexhaif/Qwen3-4B-MTEval-SFT")
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 Rexhaif/Qwen3-4B-MTEval-SFT with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Rexhaif/Qwen3-4B-MTEval-SFT"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Rexhaif/Qwen3-4B-MTEval-SFT",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Rexhaif/Qwen3-4B-MTEval-SFT
How to use Rexhaif/Qwen3-4B-MTEval-SFT with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Rexhaif/Qwen3-4B-MTEval-SFT" \
--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": "Rexhaif/Qwen3-4B-MTEval-SFT",
"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 "Rexhaif/Qwen3-4B-MTEval-SFT" \
--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": "Rexhaif/Qwen3-4B-MTEval-SFT",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Rexhaif/Qwen3-4B-MTEval-SFT with Docker Model Runner:
docker model run hf.co/Rexhaif/Qwen3-4B-MTEval-SFT
axolotl version: 0.9.2
base_model: Qwen/Qwen3-4B
# Automatically upload checkpoint and final model to HF
hub_model_id: Rexhaif/Qwen3-4B-MTEval-SFT
hub_private_repo: false
load_in_8bit: false
load_in_4bit: false
strict: false
chat_template: tokenizer_default
datasets:
- path: Rexhaif/wmt23-pairs-sft
split: "train"
type: chat_template
field_messages: messages
roles_to_train: ["assistant"]
shuffle_merged_datasets: true
skip_prepare_dataset: false
dataset_prepared_path: ./data/wmt23-pairs-sft
output_dir: /hnvme/workspace/v106be28-outputs/sft-4b
dataloader_prefetch_factor: 32
dataloader_num_workers: 2
dataloader_pin_memory: true
gc_steps: 1
sequence_len: 512
sample_packing: false
eval_sample_packing: false
pad_to_sequence_len: false
wandb_project: llm-reasoning-mt-eval
wandb_entity:
wandb_name: qwen3-4b-sft
plugins:
- axolotl.integrations.liger.LigerPlugin
liger_rope: true
liger_rms_norm: true
liger_glu_activation: true
liger_layer_norm: true
liger_fused_linear_cross_entropy: true
gradient_accumulation_steps: 2
micro_batch_size: 32 # should match num_generations / num_gpus
optimizer: adamw_torch_fused
lr_scheduler: cosine
learning_rate: 5.0e-5
cosine_min_lr_ratio: 1.0e-7
max_grad_norm: 1.0
weight_decay: 0.1
bf16: true
tf32: true
flash_attention: true
flash_attn_fuse_qkv: true
flash_attn_fuse_mlp: true
auto_resume_from_checkpoints: true
n_epochs: 3
logging_steps: 10
warmup_ratio: 0.1
evals_per_epoch: 10
saves_per_epoch: 10
save_total_limit: 1
#max_steps: 5000
seed: 42
val_set_size: 0.01
gradient_checkpointing: false
gradient_checkpointing_kwargs:
use_reentrant: false
This model is a fine-tuned version of Qwen/Qwen3-4B on the Rexhaif/wmt23-pairs-sft 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 |
|---|---|---|---|
| No log | 0.0010 | 1 | 19.7622 |
| 0.251 | 0.1003 | 102 | 0.2284 |
| 0.2008 | 0.2007 | 204 | 0.1928 |
| 0.1571 | 0.3010 | 306 | 0.1638 |
| 0.1264 | 0.4014 | 408 | 0.1307 |
| 0.0964 | 0.5017 | 510 | 0.1090 |
| 0.0933 | 0.6021 | 612 | 0.0939 |
| 0.0628 | 0.7024 | 714 | 0.0762 |
| 0.0581 | 0.8028 | 816 | 0.0598 |
| 0.0519 | 0.9031 | 918 | 0.0511 |