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

Commit

Permalink
Mutators inside parlai_internal and parlai_fb (#3623)
Browse files Browse the repository at this point in the history
* Import mutators from other projects
  • Loading branch information
stephenroller authored May 3, 2021
1 parent 0120e9e commit 1d21237
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions parlai/core/mutators.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ def setup_mutator_registry():
return
for module in pkgutil.iter_modules(parlai.mutators.__path__, 'parlai.mutators.'):
importlib.import_module(module.name)
try:
import parlai_fb.mutators

for module in pkgutil.iter_modules(
parlai_fb.mutators.__path__, 'parlai_fb.mutators.'
):
importlib.import_module(module.name)
except ImportError:
pass
try:
import parlai_internal.mutators

for module in pkgutil.iter_modules(
parlai_internal.mutators.__path__, 'parlai_internal.mutators.'
):
importlib.import_module(module.name)
except ImportError:
pass
setup_mutator_registry.loaded = True
return MUTATOR_REGISTRY

Expand Down

0 comments on commit 1d21237

Please sign in to comment.