From 7ae537fc9d29bb75628773687921640f8cd817b4 Mon Sep 17 00:00:00 2001 From: Sai-Suraj-27 Date: Sat, 29 Nov 2025 09:46:00 +0530 Subject: [PATCH] Fix missing model attribute in Glm4vMoeIntegrationTest --- tests/models/glm4v_moe/test_modeling_glm4v_moe.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/models/glm4v_moe/test_modeling_glm4v_moe.py b/tests/models/glm4v_moe/test_modeling_glm4v_moe.py index afae9ef118a8..bc66f32a14ca 100644 --- a/tests/models/glm4v_moe/test_modeling_glm4v_moe.py +++ b/tests/models/glm4v_moe/test_modeling_glm4v_moe.py @@ -294,11 +294,13 @@ def test_inputs_embeds_matches_input_ids(self): @require_torch @slow class Glm4vMoeIntegrationTest(unittest.TestCase): - model = None + @classmethod + def setUpClass(cls): + cls.model = None @classmethod def get_model(cls): - if cls.model is None: + if not hasattr(cls, "model") or cls.model is None: cls.model = Glm4vMoeForConditionalGeneration.from_pretrained( "zai-org/GLM-4.5V", dtype="auto", device_map="auto" )