[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 22:28:25 +00:00
committed by GitHub
co-authored by Simon Mo
parent 92cd2e2f21
commit 934d3662f7
+3 -1
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. ")