Qwen 2.5 Omni: apply video defaults (#37660)

* Apply video defaults for min_pixels and max_pixels

* fps kwarg should not be a list

* Update test to account for new resizing
This commit is contained in:
Pedro Cuenca
2025-04-23 17:08:11 +02:00
committed by GitHub
parent 1e9087368c
commit 63c6331387
2 changed files with 8 additions and 7 deletions

View File

@@ -433,7 +433,7 @@ class Qwen2_5OmniProcessorTest(ProcessorTesterMixin, unittest.TestCase):
num_frames=num_frames,
)
self.assertTrue(self.videos_input_name in out_dict_with_video)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 9568)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 5760)
# Load with `video_fps` arg
video_fps = 1
@@ -445,7 +445,7 @@ class Qwen2_5OmniProcessorTest(ProcessorTesterMixin, unittest.TestCase):
video_fps=video_fps,
)
self.assertTrue(self.videos_input_name in out_dict_with_video)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 23920)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 14400)
# Load with `video_fps` and `num_frames` args, should raise an error
with self.assertRaises(ValueError):
@@ -466,7 +466,7 @@ class Qwen2_5OmniProcessorTest(ProcessorTesterMixin, unittest.TestCase):
return_dict=True,
)
self.assertTrue(self.videos_input_name in out_dict_with_video)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 717600)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 432000)
# Load video as a list of frames (i.e. images). NOTE: each frame should have same size
# because we assume they come from one video
@@ -484,7 +484,7 @@ class Qwen2_5OmniProcessorTest(ProcessorTesterMixin, unittest.TestCase):
return_dict=True,
)
self.assertTrue(self.videos_input_name in out_dict_with_video)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 5704)
self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 2904)
@require_av
def test_apply_chat_template_video_special_processing(self):