Skip to content

GRPO for Qwen3-VL #232

@woxihuanjiangguo

Description

@woxihuanjiangguo

Hi authors,

I am using GRPO to fine-tune Qwen/Qwen3-VL-2B-Instruct and encoutering the following error:

[rank0]:   File "src/trainer/grpo_trainer.py", line 53, in _generate_and_score_completions
[rank0]:     prompts = [x["prompt"] for x in inputs]
[rank0]:   File "src/trainer/grpo_trainer.py", line 53, in <listcomp>
[rank0]:     prompts = [x["prompt"] for x in inputs]
[rank0]:                ~^^^^^^^^^^
[rank0]: TypeError: string indices must be integers, not 'str'

It looks like the autoprocessor of Qwen3-VL is turning the inputs into a BatchFeature object with the following keys:
b.data.keys() Out[8]: dict_keys(['input_ids', 'attention_mask', 'pixel_values', 'image_grid_thw'])

Are there any quick fixes I can do? Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions