Unverified Commit e840aa67 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix failing `MusicgenTest .test_pipeline_text_to_audio` (#26586)



* fix

* fix

* Fix

* Fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 87499420
...@@ -502,8 +502,12 @@ def validate_test_components(test_case, task, model, tokenizer, processor): ...@@ -502,8 +502,12 @@ def validate_test_components(test_case, task, model, tokenizer, processor):
if tokenizer is not None: if tokenizer is not None:
config_vocab_size = getattr(model.config, "vocab_size", None) config_vocab_size = getattr(model.config, "vocab_size", None)
# For CLIP-like models # For CLIP-like models
if config_vocab_size is None and hasattr(model.config, "text_config"): if config_vocab_size is None:
config_vocab_size = getattr(model.config.text_config, "vocab_size", 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: if config_vocab_size is None and model.config.__class__.__name__ not in CONFIG_WITHOUT_VOCAB_SIZE:
raise ValueError( raise ValueError(
"Could not determine `vocab_size` from model configuration while `tokenizer` is not `None`." "Could not determine `vocab_size` from model configuration while `tokenizer` is not `None`."
......
...@@ -4151,7 +4151,7 @@ ...@@ -4151,7 +4151,7 @@
], ],
"processor_classes": [], "processor_classes": [],
"model_classes": [], "model_classes": [],
"sha": "37e9ae5dafb601daa8364e9ac17da31cd82b274b" "sha": "f67d387eaaa7c71ddf88af95eda4bf14ace08d49"
}, },
"MusicgenForConditionalGeneration": { "MusicgenForConditionalGeneration": {
"tokenizer_classes": [ "tokenizer_classes": [
...@@ -4161,7 +4161,7 @@ ...@@ -4161,7 +4161,7 @@
"model_classes": [ "model_classes": [
"MusicgenForConditionalGeneration" "MusicgenForConditionalGeneration"
], ],
"sha": "b71611b88832e53370e676da53b65042f7fc78ee" "sha": "16102cdf580e70cf0b4e0e2cda5bc75b934da92c"
}, },
"MvpForCausalLM": { "MvpForCausalLM": {
"tokenizer_classes": [ "tokenizer_classes": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment