diff --git a/tests/test_pipeline_mixin.py b/tests/test_pipeline_mixin.py index eebf4eaa256..3447577ac57 100644 --- a/tests/test_pipeline_mixin.py +++ b/tests/test_pipeline_mixin.py @@ -502,8 +502,12 @@ def validate_test_components(test_case, task, model, tokenizer, processor): if tokenizer is not None: config_vocab_size = getattr(model.config, "vocab_size", None) # For CLIP-like models - if config_vocab_size is None and hasattr(model.config, "text_config"): - config_vocab_size = getattr(model.config.text_config, "vocab_size", None) + if config_vocab_size is None: + if hasattr(model.config, "text_config"): + config_vocab_size = getattr(model.config.text_config, "vocab_size", None) + elif hasattr(model.config, "text_encoder"): + config_vocab_size = getattr(model.config.text_encoder, "vocab_size", None) + if config_vocab_size is None and model.config.__class__.__name__ not in CONFIG_WITHOUT_VOCAB_SIZE: raise ValueError( "Could not determine `vocab_size` from model configuration while `tokenizer` is not `None`." diff --git a/tests/utils/tiny_model_summary.json b/tests/utils/tiny_model_summary.json index e084780268f..2a1efa7d88d 100644 --- a/tests/utils/tiny_model_summary.json +++ b/tests/utils/tiny_model_summary.json @@ -4151,7 +4151,7 @@ ], "processor_classes": [], "model_classes": [], - "sha": "37e9ae5dafb601daa8364e9ac17da31cd82b274b" + "sha": "f67d387eaaa7c71ddf88af95eda4bf14ace08d49" }, "MusicgenForConditionalGeneration": { "tokenizer_classes": [ @@ -4161,7 +4161,7 @@ "model_classes": [ "MusicgenForConditionalGeneration" ], - "sha": "b71611b88832e53370e676da53b65042f7fc78ee" + "sha": "16102cdf580e70cf0b4e0e2cda5bc75b934da92c" }, "MvpForCausalLM": { "tokenizer_classes": [