Skip to content

Commit e5a9a1d

Browse files
CyrilvallezArthurZucker
authored andcommitted
Fix Glm4v test (#41011)
fix
1 parent b2b5044 commit e5a9a1d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/models/glm4v_moe/test_modeling_glm4v_moe.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def test_inputs_embeds_matches_input_ids(self):
297297

298298

299299
@require_torch
300+
@slow
300301
class Glm4vMoeIntegrationTest(unittest.TestCase):
301302
model = None
302303

@@ -310,7 +311,8 @@ def get_model(cls):
310311

311312
@classmethod
312313
def tearDownClass(cls):
313-
del cls.model
314+
if hasattr(cls, "model"):
315+
del cls.model
314316
cleanup(torch_device, gc_collect=True)
315317

316318
def setUp(self):
@@ -364,7 +366,6 @@ def setUp(self):
364366
def tearDown(self):
365367
cleanup(torch_device, gc_collect=True)
366368

367-
@slow
368369
def test_small_model_integration_test(self):
369370
inputs = self.processor.apply_chat_template(
370371
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):
386387
)
387388
torch.testing.assert_close(expected_pixel_slice, inputs.pixel_values[:6, :3], atol=1e-4, rtol=1e-4)
388389

389-
@slow
390390
def test_small_model_integration_test_batch(self):
391391
model = self.get_model()
392392
batch_messages = [self.message, self.message2, self.message_wo_image]
@@ -414,7 +414,6 @@ def test_small_model_integration_test_batch(self):
414414
EXPECTED_DECODED_TEXT,
415415
)
416416

417-
@slow
418417
def test_small_model_integration_test_with_video(self):
419418
processor = AutoProcessor.from_pretrained("zai-org/GLM-4.5V", max_image_size={"longest_edge": 50176})
420419
model = self.get_model()
@@ -437,7 +436,6 @@ def test_small_model_integration_test_with_video(self):
437436
)
438437

439438
@run_first
440-
@slow
441439
@require_flash_attn
442440
@require_torch_gpu
443441
def test_small_model_integration_test_batch_flashatt2(self):

0 commit comments

Comments
 (0)