diff --git a/tests/models/internvl/test_processing_internvl.py b/tests/models/internvl/test_processing_internvl.py index b5cf23c8d2..5f073e3d39 100644 --- a/tests/models/internvl/test_processing_internvl.py +++ b/tests/models/internvl/test_processing_internvl.py @@ -234,7 +234,7 @@ class InternVLProcessorTest(ProcessorTesterMixin, unittest.TestCase): self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), num_frames) - # Load with `video_fps` arg is not possible with InternVL (skip) + # Load with `fps` arg is not possible with InternVL (skip) # Load without any arg should use the default loading method out_dict_with_video = processor.apply_chat_template( diff --git a/tests/models/qwen2_5_omni/test_processing_qwen2_5_omni.py b/tests/models/qwen2_5_omni/test_processing_qwen2_5_omni.py index 8295084b78..49684431cf 100644 --- a/tests/models/qwen2_5_omni/test_processing_qwen2_5_omni.py +++ b/tests/models/qwen2_5_omni/test_processing_qwen2_5_omni.py @@ -488,26 +488,26 @@ class Qwen2_5OmniProcessorTest(ProcessorTesterMixin, unittest.TestCase): self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 5760) - # Load with `video_fps` arg - video_fps = 1 + # Load with `fps` arg + fps = 1 out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, ) self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 14400) - # Load with `video_fps` and `num_frames` args, should raise an error + # Load with `fps` and `num_frames` args, should raise an error with self.assertRaises(ValueError): out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, num_frames=num_frames, ) diff --git a/tests/models/qwen2_5_vl/test_processing_qwen2_5_vl.py b/tests/models/qwen2_5_vl/test_processing_qwen2_5_vl.py index e05238d588..4f2e1769bc 100644 --- a/tests/models/qwen2_5_vl/test_processing_qwen2_5_vl.py +++ b/tests/models/qwen2_5_vl/test_processing_qwen2_5_vl.py @@ -304,26 +304,26 @@ class Qwen2_5_VLProcessorTest(ProcessorTesterMixin, unittest.TestCase): self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 360) - # Load with `video_fps` arg - video_fps = 1 + # Load with `fps` arg + fps = 1 out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, ) self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 900) - # Load with `video_fps` and `num_frames` args, should raise an error + # Load with `fps` and `num_frames` args, should raise an error with self.assertRaises(ValueError): out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, num_frames=num_frames, ) diff --git a/tests/models/qwen2_vl/test_processing_qwen2_vl.py b/tests/models/qwen2_vl/test_processing_qwen2_vl.py index 05a82f5fc9..b044981f9d 100644 --- a/tests/models/qwen2_vl/test_processing_qwen2_vl.py +++ b/tests/models/qwen2_vl/test_processing_qwen2_vl.py @@ -304,26 +304,26 @@ class Qwen2VLProcessorTest(ProcessorTesterMixin, unittest.TestCase): self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 360) - # Load with `video_fps` arg - video_fps = 1 + # Load with `fps` arg + fps = 1 out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, ) self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 900) - # Load with `video_fps` and `num_frames` args, should raise an error + # Load with `fps` and `num_frames` args, should raise an error with self.assertRaises(ValueError): out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, num_frames=num_frames, ) diff --git a/tests/models/smolvlm/test_processing_smolvlm.py b/tests/models/smolvlm/test_processing_smolvlm.py index 88f1c79902..45a7a94520 100644 --- a/tests/models/smolvlm/test_processing_smolvlm.py +++ b/tests/models/smolvlm/test_processing_smolvlm.py @@ -417,20 +417,20 @@ class SmolVLMProcessorTest(ProcessorTesterMixin, unittest.TestCase): # SmolVLM doesn't sample `num_frames` exactly, by uses other sampling method self.assertEqual(len(out_dict_with_video[self.videos_input_name][0]), 3) - # Load with `video_fps` arg - video_fps = 1 + # Load with `fps` arg + fps = 1 out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, return_tensors="pt", ) self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 1) # SmolVLM doesn't sample 1 frame per second exactly, by uses other sampling method - self.assertEqual(len(out_dict_with_video[self.videos_input_name][0]), video_fps * 10) + self.assertEqual(len(out_dict_with_video[self.videos_input_name][0]), fps * 10) # NOTE: the last assert checks are removed # Loading video as a list of frames (i.e. images) is not supported in SmolVLM diff --git a/tests/test_processing_common.py b/tests/test_processing_common.py index 6abc3de1c6..6be8843531 100644 --- a/tests/test_processing_common.py +++ b/tests/test_processing_common.py @@ -991,43 +991,43 @@ class ProcessorTesterMixin: self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 1) self.assertEqual(len(out_dict_with_video[self.videos_input_name][0]), num_frames) - # Load with `video_fps` arg - video_fps = 1 + # Load with `fps` arg + fps = 1 out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, return_tensors="pt", ) self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 1) - self.assertEqual(len(out_dict_with_video[self.videos_input_name][0]), video_fps * 10) + self.assertEqual(len(out_dict_with_video[self.videos_input_name][0]), fps * 10) # Whan `do_sample_frames=False` no sampling is done and whole video is loaded, even if number of frames is passed - video_fps = 1 + fps = 1 out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, do_sample_frames=False, - video_fps=video_fps, + fps=fps, return_tensors="pt", ) self.assertTrue(self.videos_input_name in out_dict_with_video) self.assertEqual(len(out_dict_with_video[self.videos_input_name]), 1) self.assertEqual(len(out_dict_with_video[self.videos_input_name][0]), 300) - # Load with `video_fps` and `num_frames` args, should raise an error + # Load with `fps` and `num_frames` args, should raise an error with self.assertRaises(ValueError): out_dict_with_video = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, - video_fps=video_fps, + fps=fps, num_frames=num_frames, )