[Bugfix] handle hf_config with architectures == None (#3982)

Signed-off-by: Travis Johnson <tsjohnso@us.ibm.com>
Co-authored-by: Simon Mo <simon.mo@hey.com>
This commit is contained in:
Travis Johnson 2024-04-10 16:28:25 -06:00 committed by GitHub
parent 92cd2e2f21
commit 934d3662f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,7 +158,9 @@ class ModelConfig:
# TODO: Remove this check once HF updates the pt weights of Mixtral.
architectures = getattr(self.hf_config, "architectures", [])
if "MixtralForCausalLM" in architectures and load_format == "pt":
# architectures can be None instead of []
if architectures and "MixtralForCausalLM" in architectures \
and load_format == "pt":
raise ValueError(
"Currently, the 'pt' format is not supported for Mixtral. "
"Please use the 'safetensors' format instead. ")