Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Zoo import error message improvement #3445

Merged
merged 1 commit into from
Feb 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions parlai/core/build_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,12 @@ def modelzoo_path(datapath, path):
module_name_ = 'parlai.zoo.{}'.format(animal_)
my_module = importlib.import_module(module_name_)
my_module.download(datapath)
except (ImportError, AttributeError):
except (ImportError, AttributeError) as exc:
# truly give up
raise ImportError(
f'Could not find pretrained model in {module_name} or {module_name_}.'
)
' Please check your spelling and make sure you\'ve pulled from master.'
) from exc

return os.path.join(datapath, 'models', model_path)
else:
Expand Down