ignore files starting with . e.g. .ipynb_checkpoints
Summary:
.ipynb_checkpoints folder in models folders crashed the importlib
now there is a check for this
Pull Request resolved:
@@ -123,7 +123,7 @@ def register_model_architecture(model_name, arch_name):
models_dir = os.path.dirname(__file__)
for file in os.listdir(models_dir):
path = os.path.join(models_dir, file)
- if not file.startswith('_') and (file.endswith('.py') or os.path.isdir(path)):
+ if not file.startswith('_') and not file.startswith('.') and (file.endswith('.py') or os.path.isdir(path)):
model_name = file[:file.find('.py')] if file.endswith('.py') else file
module = importlib.import_module('fairseq.models.' + model_name)
