Unverified Commit 5d6feecf authored by Nathan Dahlberg's avatar Nathan Dahlberg Committed by GitHub
Browse files

fix for 17292 (#17293)

parent 518bd02c
......@@ -1815,7 +1815,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
"there is a file for TensorFlow weights. Use `from_tf=True` to load this model from those "
"weights."
)
elif os.path.join(pretrained_model_name_or_path, FLAX_WEIGHTS_NAME):
elif os.path.isfile(os.path.join(pretrained_model_name_or_path, FLAX_WEIGHTS_NAME)):
raise EnvironmentError(
f"Error no file named {WEIGHTS_NAME} found in directory {pretrained_model_name_or_path} but "
"there is a file for Flax weights. Use `from_flax=True` to load this model from those "
......
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