Skip to content

Commit

Permalink
Merge pull request #319 from facebookresearch/change-other-world-loading
Browse files Browse the repository at this point in the history
Change how the ParlAI chat world is loaded throughout
  • Loading branch information
EricMichaelSmith authored Dec 1, 2020
2 parents b23d5b5 + 581dea5 commit 1fcc45d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ def __init__(

if shared_state.world_module is None:
world_file_path = os.path.expanduser(args.blueprint.world_file)
world_module_path = world_file_path[:-3]
sys.path.append(world_module_path)
world_module_dir = os.path.dirname(world_file_path)
sys.path.append(world_module_dir)
world_module_name = os.path.basename(world_file_path)[:-3]
world_module = import_module(world_module_name)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def __init__(
):
super().__init__(task_run, args, shared_state)
world_file_path = os.path.expanduser(args.blueprint.world_file)
world_module_path = world_file_path[:-3]
sys.path.append(world_module_path)
world_module_dir = os.path.dirname(world_file_path)
sys.path.append(world_module_dir)
world_module_name = os.path.basename(world_file_path)[:-3]
self.parlai_world_module = import_module(world_module_name)
world_params = self.parlai_world_module.get_world_params()
Expand Down

0 comments on commit 1fcc45d

Please sign in to comment.