Fine tuning on qwen3

Hi,

I am not able to finetune Qwen3-4B model by using parameters;

FastVisionModel.for_training(model) # Enable for training!

trainer = SFTTrainer(
model = model,
tokenizer = tokenizer,
data_collator = UnslothVisionDataCollator(model, tokenizer),
train_dataset = processed_dataset,
args = SFTConfig(
per_device_train_batch_size = 2,
gradient_accumulation_steps = 4,
warmup_steps = 5,
max_steps = 30,
learning_rate = 2e-4,
fp16 = not is_bf16_supported(),
bf16 = is_bf16_supported(),
logging_steps = 1,
optim = “adamw_8bit”,
weight_decay = 0.01,
lr_scheduler_type = “linear”,
seed = 3407,
output_dir = “outputs”,
report_to = “none”,
remove_unused_columns = False,
dataset_text_field = “”,
dataset_kwargs = {“skip_prepare_dataset”: True},
dataset_num_proc = 4,
max_seq_length = 2048,
),
)

Returns
TypeError: Unsloth: UnslothVisionDataCollator is only for image models!

Can anyone help me?

1 Like

Hi @orkungedik

It seems you’re using Unsloth to finutune the model, but I’m not sure why you’re using FastVisionModel. As far as I know, Qwen/Qwen3-4B is a text-only model.

I believe you can follow this notebook instead of your current script:
Colab Notebook

1 Like

Hi @mahmutc,

Yes it’s looking text-only but it says multi-model in the documentation. I fine-tuned 7B VL model previously. Just trying to understand can qwen3 model fine tune by images to extract data.

1 Like