Problem
In _compute_rollout_loss (trainer.py:519-525), after concatenating action token IDs to prompt input_ids, only input_ids and attention_mask are updated. VLM-specific keys like pixel_values, image_grid_thw (Qwen2.5-VL) retain their original shapes tied to the prompt-only length. This may cause image token position misalignment during the forward pass.
Additionally, line 525 does {k: v.to(device) for k, v in full_inputs.items()} which fails if any value is not a tensor (e.g., integer metadata in processor output). Need an isinstance(v, torch.Tensor) guard.
Problem
In
_compute_rollout_loss(trainer.py:519-525), after concatenating action token IDs to promptinput_ids, onlyinput_idsandattention_maskare updated. VLM-specific keys likepixel_values,image_grid_thw(Qwen2.5-VL) retain their original shapes tied to the prompt-only length. This may cause image token position misalignment during the forward pass.Additionally, line 525 does
{k: v.to(device) for k, v in full_inputs.items()}which fails if any value is not a tensor (e.g., integer metadata in processor output). Need anisinstance(v, torch.Tensor)guard.