Reduce Glm4v model test size significantly (#39173)

* fix test size

* Update test_modeling_glm4v.py
This commit is contained in:
Cyril Vallez
2025-07-02 15:55:05 +02:00
committed by GitHub
parent e355c0a11c
commit 2b4a12b5bf

View File

@@ -69,16 +69,15 @@ class Glm4vVisionText2TextModelTester:
is_training=True, is_training=True,
text_config={ text_config={
"vocab_size": 99, "vocab_size": 99,
"hidden_size": 32, "hidden_size": 16,
"intermediate_size": 37, "intermediate_size": 22,
"num_hidden_layers": 4, "num_hidden_layers": 2,
"num_attention_heads": 4, "num_attention_heads": 2,
"num_key_value_heads": 2, "num_key_value_heads": 1,
"output_channels": 64, "output_channels": 64,
"hidden_act": "silu", "hidden_act": "silu",
"max_position_embeddings": 512, "max_position_embeddings": 512,
"rope_scaling": {"type": "default", "mrope_section": [2, 1, 1]}, "rope_scaling": {"type": "default", "mrope_section": [2, 1, 1]},
"max_window_layers": 3,
"rope_theta": 10000, "rope_theta": 10000,
"tie_word_embeddings": True, "tie_word_embeddings": True,
"bos_token_id": 0, "bos_token_id": 0,
@@ -87,11 +86,10 @@ class Glm4vVisionText2TextModelTester:
}, },
vision_config={ vision_config={
"depth": 2, "depth": 2,
"embed_dim": 32,
"hidden_act": "silu", "hidden_act": "silu",
"hidden_size": 32, "hidden_size": 48,
"mlp_ratio": 4, "out_hidden_size": 16,
"num_heads": 4, "intermediate_size": 22,
"patch_size": 14, "patch_size": 14,
"spatial_merge_size": 1, "spatial_merge_size": 1,
"temporal_patch_size": 2, "temporal_patch_size": 2,
@@ -239,10 +237,6 @@ class Glm4vModelTest(ModelTesterMixin, GenerationTesterMixin, unittest.TestCase)
def test_multi_gpu_data_parallel_forward(self): def test_multi_gpu_data_parallel_forward(self):
pass pass
@unittest.skip(reason="We cannot configure to output a smaller model.")
def test_model_is_small(self):
pass
@unittest.skip("Error with compilation") @unittest.skip("Error with compilation")
def test_generate_from_inputs_embeds_with_static_cache(self): def test_generate_from_inputs_embeds_with_static_cache(self):
pass pass