Improved zoo error message, exception chaining
@@ -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:
