"vscode:/vscode.git/clone" did not exist on "f63ff536adfee0505a64d02649ef4b55dde614bb"
Unverified Commit af471ce5 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

Improved Error message when loading config/model with .from_pretrained() (#3247)

* better error message

* better error message

* update to model identifier instead of url

* update to model identifier instead of ur
parent 5ea8ba67
......@@ -250,10 +250,17 @@ class PretrainedConfig(object):
)
else:
msg = (
"Model name '{}' was not found in model name list. "
"We assumed '{}' was a path, a model identifier, or url to a configuration file named {} or "
"a directory containing such a file but couldn't find any such file at this path or url.".format(
pretrained_model_name_or_path, config_file, CONFIG_NAME,
"Can't load '{}'. Make sure that:\n\n"
"- '{}' is either a correct model identifier of a community model from 'https://huggingface.co/models' which has a '{}' file\n\n"
"- or '{}' is a model name in {}\n\n"
"- or '{}' is the correct path to a directory containing a '{}' file".format(
pretrained_model_name_or_path,
pretrained_model_name_or_path,
CONFIG_NAME,
pretrained_model_name_or_path,
list(pretrained_config_archive_map.keys()),
pretrained_model_name_or_path,
CONFIG_NAME,
)
)
raise EnvironmentError(msg)
......
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