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

Refactor analysis for per turn eval #3780

Merged
merged 8 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 6 additions & 3 deletions parlai/crowdsourcing/tasks/model_chat/model_chat_blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ def __init__(

# Load task configuration data beyond the task description, as the super does
# that
left_pane_path = os.path.expanduser(args.blueprint.left_pane_text_path)
with open(left_pane_path, "r") as left_pane_file:
self.left_pane_text = left_pane_file.read()
self.left_pane_text = self.process_left_pane_text(args)
self.annotations_config: Optional[str] = None
if args.blueprint.get("annotations_config_path", "") != "":
annotations_config_path = os.path.expanduser(
Expand Down Expand Up @@ -253,6 +251,11 @@ def __init__(
}
)

def process_left_pane_text(self, args: "DictConfig") -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, honestly, I think that these 3 lines of code will probably be the same for all subclasses of model_chat, meaning that the lines will need to get repeated in all subclasses. I think it'll lead to less duplicated code if, instead, there's a method called something like format_left_pane_text(), which you just define as pass for this superclass

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

left_pane_path = os.path.expanduser(args.blueprint.left_pane_text_path)
with open(left_pane_path, "r") as left_pane_file:
return left_pane_file.read()

@abstractmethod
def _get_shared_models(self, args: "DictConfig") -> Dict[str, dict]:
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
blender_90M: >
--model-file zoo:blender/blender_90M/model

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: extra space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved