diff --git a/tests/models/glm4v_moe/test_modeling_glm4v_moe.py b/tests/models/glm4v_moe/test_modeling_glm4v_moe.py index 995b3c0723db..1881fffa9dd9 100644 --- a/tests/models/glm4v_moe/test_modeling_glm4v_moe.py +++ b/tests/models/glm4v_moe/test_modeling_glm4v_moe.py @@ -297,6 +297,7 @@ def test_inputs_embeds_matches_input_ids(self): @require_torch +@slow class Glm4vMoeIntegrationTest(unittest.TestCase): model = None @@ -310,7 +311,8 @@ def get_model(cls): @classmethod def tearDownClass(cls): - del cls.model + if hasattr(cls, "model"): + del cls.model cleanup(torch_device, gc_collect=True) def setUp(self): @@ -364,7 +366,6 @@ def setUp(self): def tearDown(self): cleanup(torch_device, gc_collect=True) - @slow def test_small_model_integration_test(self): inputs = self.processor.apply_chat_template( self.message, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt" @@ -386,7 +387,6 @@ def test_small_model_integration_test(self): ) torch.testing.assert_close(expected_pixel_slice, inputs.pixel_values[:6, :3], atol=1e-4, rtol=1e-4) - @slow def test_small_model_integration_test_batch(self): model = self.get_model() batch_messages = [self.message, self.message2, self.message_wo_image] @@ -414,7 +414,6 @@ def test_small_model_integration_test_batch(self): EXPECTED_DECODED_TEXT, ) - @slow def test_small_model_integration_test_with_video(self): processor = AutoProcessor.from_pretrained("zai-org/GLM-4.5V", max_image_size={"longest_edge": 50176}) model = self.get_model() @@ -437,7 +436,6 @@ def test_small_model_integration_test_with_video(self): ) @run_first - @slow @require_flash_attn @require_torch_gpu def test_small_model_integration_test_batch_flashatt2(self):