transformers
f5af3202 - [PerceptionLM] Restore test_inputs_embeds overrides to fix flaky test (#49165)

Commit
48 days ago
[PerceptionLM] Restore test_inputs_embeds overrides to fix flaky test (#49165) [PerceptionLM] Restore test_inputs_embeds overrides to fix flaky test_inputs_embeds_matches_input_ids PR #45783 removed the custom `test_inputs_embeds` and `test_inputs_embeds_matches_input_ids` overrides, expecting the inherited base-class versions to work. However, the inherited test replaces pad tokens with `not_pad_token_id = pad_token_id + 1 = 2`, which equals `video_token_id = 2`, accidentally introducing extra video tokens. Combined with the base-class not deleting `pixel_values_videos`, the model encodes 3 video features (batch_size=3) but finds 4 video tokens → flaky ValueError (~14-21% failure rate). Fix: restore both overrides that delete pixel_values and pixel_values_videos before comparing input_ids vs inputs_embeds outputs. Verified: 500/500 passes after fix. Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Author
Parents
Loading