yotisstudios/Warrior-SFT-v2
Viewer • Updated • 6.01k • 45
How to use yotisstudios/Warrior-v2-Qwen3.5-4B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="yotisstudios/Warrior-v2-Qwen3.5-4B")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
pipe(text=messages) # Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("yotisstudios/Warrior-v2-Qwen3.5-4B")
model = AutoModelForMultimodalLM.from_pretrained("yotisstudios/Warrior-v2-Qwen3.5-4B", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use yotisstudios/Warrior-v2-Qwen3.5-4B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "yotisstudios/Warrior-v2-Qwen3.5-4B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "yotisstudios/Warrior-v2-Qwen3.5-4B",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'docker model run hf.co/yotisstudios/Warrior-v2-Qwen3.5-4B
How to use yotisstudios/Warrior-v2-Qwen3.5-4B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "yotisstudios/Warrior-v2-Qwen3.5-4B" \
--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": "yotisstudios/Warrior-v2-Qwen3.5-4B",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'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 "yotisstudios/Warrior-v2-Qwen3.5-4B" \
--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": "yotisstudios/Warrior-v2-Qwen3.5-4B",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'How to use yotisstudios/Warrior-v2-Qwen3.5-4B with Docker Model Runner:
docker model run hf.co/yotisstudios/Warrior-v2-Qwen3.5-4B
| Parameter | Value |
|---|---|
| Training Mode | SFT |
| Base Model | Lazarus-Ai/ReAligned-Qwen3.5-4B |
| Learning Rate | 0.0002 |
| Epochs | 2 |
| Batch Size | 1 |
| Gradient Accumulation | 16 |
| Effective Batch Size | 16 |
| Max Sequence Length | 8192 |
| Optimizer | paged_adamw_8bit |
| LR Scheduler | cosine |
| Warmup Ratio | 0.05 |
| Weight Decay | 0.01 |
| Max Grad Norm | 0.3 |
| Seed | 42 |
| LoRA Rank (r) | 64 |
| LoRA Alpha | 128 |
| LoRA Dropout | 0.05 |
| Target Modules | up_proj, down_proj, gate_proj, k_proj, q_proj, v_proj, o_proj |
| Quantization | 4-bit (NF4) |
| GPU | NVIDIA GB10 |
This model was trained with Merlina. Credentials are not included — Merlina will use your own HF_TOKEN and WANDB_API_KEY from .env or the form.
Paste this code into Merlina's Load Configuration → From Code to rebuild the exact training setup:
merlina-config-v1:H4sIAB3PgGoC_61VTY_jNgz9K4HOScbxZgczuU0L9NKZw3a36KEoBMambTWSpdVHstnF_PeSspVk0BYLFL3RFE09Pj5S34Q0GKGFCGL3TYxgUOzEb-C9sn51rFcfTji-W79fbX8QS9FiaLxyUdmRoj55UKMa-0Vjx071yQMfLMIAHttF561ZwOIFvVYjrCIHk9vYFvWackXog9j9_sdShGZAQ9cLM8XexTnxakosSog8og_57s2yBF99ol7X60q8LsUeAsp8EXmf4Sv4FFZP6u4XfNKqJxRvq7IpuhTld2pPlFNbTzijT7gUbEsvdvfb2QbtBjrd1A-zo_XWUW6xq9bVey7Y9xgZV9LIpYvkpPP2TybWnsZi9xCx2IdifC7GsRh2Moi_OaOMVgY44kRqRhAhHGQ8O67rx6dfPz49y-cX-lcjeCZYUssw46uqeinGZCQ62wyErmYaYzPIoL5iJrz30Coco4SmSSbp3G0ZIjoK39wTDvgiNY59HMTuYfNYTx5CaVy8HGyqepshoy7IIEXLgpi7njtH7tBF8u6RlVmtCYCGPf0UjLVxoLiMm-kyJkcQxSzjgJGVHGzyDV6tctmQ-p5-7oAOl8JTuVK15D_bqEKIqVU23BUNfPzpE-mA9ee0orQTRv6OHsFkEB3ogDce-YY2IrYiRULbKqYLCH-GM0sfjxfP_w2VMv8HoJ31BjKBk1WwRHvAkSI95cQR9ppQUhMOt5m5j7LFiE28OeRpeS0dn2fs-zNJk0-DTdOCIUBP4i7ApuFrsU1UZ5PlO1-ffUiCZFH3Z7pmll4z2IDctYghzvWSdEhR4UzyNUWis-46pbVEcpz_RZRUTUCkTmxnifNkyJEAct53S3ECb2i28z4s0z91ehqWal1P-2S7V5eS-PsEY7u_FORSGHioh3T10dbrpz0k90icoCQeLLQly9BxOFWkjrfckJupD4619FZB3NAvzhLXfZ-6yx_8IT8nGCcJ5H31YSt_li-8cg6ILsfLzm3ur9oaUteRNC5zOIE6oeqHSNJo4Fyo117yUufN5YvIGhvojRA3q4YimoOzaowXLfFqy3NxWT20C-lJMqzOksmRZlpJz5o5yQcmmUcQjORtsmEIjzeOOjsei4uSKp0fGVxVD9lJIxitlx556R0x33yV_eU8NEDFO_BEdaRR-XvErAySVPyH00zQvJNX1frN3Y1WjqbKYxispnZvePdBjKNUxmk0xBbM7_K8T_ODpXrGMfFGaWjeG9K60ldpZGHmRQ7-Cor2e1Syd-l2nnLi178A96M-AzMIAAA=
Save this to data/configs/<name>.json, or import it via the Load Configuration dialog.
{
"_metadata": {
"name": "Warrior-v2-Qwen3.5-4B",
"description": "Training configuration shared from a Merlina-trained model.",
"tags": [],
"schema": "merlina/training-config",
"schema_version": 1,
"merlina_version": "2.2.0"
},
"base_model": "Lazarus-Ai/ReAligned-Qwen3.5-4B",
"output_name": "Warrior-v2-Qwen3.5-4B",
"use_lora": true,
"lora_r": 64,
"lora_alpha": 128,
"lora_dropout": 0.05,
"target_modules": [
"up_proj",
"down_proj",
"gate_proj",
"k_proj",
"q_proj",
"v_proj",
"o_proj"
],
"modules_to_save": [],
"lora_task_type": "CAUSAL_LM",
"learning_rate": 0.0002,
"num_epochs": 2,
"batch_size": 1,
"gradient_accumulation_steps": 16,
"max_length": 8192,
"max_prompt_length": 1024,
"model_type": "auto",
"training_mode": "sft",
"beta": 0.1,
"label_smoothing": 0.0,
"gamma": 0.5,
"dataset": {
"source": {
"source_type": "huggingface",
"repo_id": "yotisstudios/Warrior-SFT-v2",
"split": "train",
"streaming": false,
"streaming_batch_size": 10000
},
"additional_sources": [],
"eval_source": {
"source_type": "huggingface",
"repo_id": "yotisstudios/Warrior-SFT-v2",
"split": "val",
"streaming": false,
"streaming_batch_size": 10000
},
"format": {
"format_type": "tokenizer",
"enable_thinking": false,
"auto_detect_thinking": true
},
"model_name": "Lazarus-Ai/ReAligned-Qwen3.5-4B",
"convert_messages_format": true,
"deduplicate": false,
"dedupe_strategy": "prompt_chosen",
"test_size": 0.01,
"system_prompt_mode": "fill_empty",
"training_mode": "sft"
},
"seed": 42,
"max_grad_norm": 0.3,
"warmup_ratio": 0.05,
"eval_steps": 0.2,
"use_4bit": true,
"use_wandb": false,
"push_to_hub": false,
"merge_lora_before_upload": true,
"hf_hub_private": false,
"hf_namespace": "yotisstudios",
"export_gguf": false,
"gguf_quant_types": [
"Q4_K_M"
],
"keep_gguf_fp16": false,
"shuffle_dataset": true,
"weight_decay": 0.01,
"lr_scheduler_type": "cosine",
"gradient_checkpointing": true,
"logging_steps": 1,
"optimizer_type": "paged_adamw_8bit",
"adam_beta1": 0.9,
"adam_beta2": 0.999,
"adam_epsilon": 1e-08,
"adafactor_relative_step": false,
"adafactor_scale_parameter": false,
"adafactor_warmup_init": false,
"adafactor_decay_rate": -0.8,
"adafactor_clip_threshold": 1.0,
"attn_implementation": "auto",
"use_liger": true,
"torch_compile": false,
"eval_on_start": false,
"multi_gpu_strategy": "auto"
}