-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Crowdsourcing] can call blueprints from command line #4254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is fantastic, especially considering that you were able to remove the separate run script for ModelImageChat as well! But I wanted to check - looking at the CircleCI log for crowdsourcing_tests
, I don't see an entry for test_model_image_chat
anymore - do you know why that is?
@@ -6,7 +6,7 @@ Code for crowdsourcing tasks that use Mephisto. See the [Mephisto quick start gu | |||
|
|||
## Running tasks | |||
|
|||
Tasks are launched by calling the appropriate run script: for instance, an ACUTE-Eval run can be launched with `python parlai/crowdsourcing/tasks/acute_eval/run.py`, followed by any appropriate flags. All run parameters are set using [Hydra](https://github.com/facebookresearch/hydra): append the flag `-c job` to your run command to see a list of all available parameters, grouped by their package name (`mephisto.blueprint`, `mephisto.task`, etc.), which determines how they are called. Each run script has a YAML file of default parameters that will be loaded, found in the `hydra_configs/conf/` subfolder of each task. | |||
Tasks are launched by calling the appropriate run script: for instance, an ACUTE-Eval run can be launched with `python parlai/crowdsourcing/tasks/acute_eval/run.py`, followed by any appropriate flags. All run parameters are set using [Hydra](https://github.com/facebookresearch/hydra): append the flag `-c job` to your run command to see a list of all available parameters, grouped by their package name (`mephisto.blueprint`, `mephisto.task`, etc.), which determines how they are called. Each run script points to a YAML file of default parameters (including the blueprints) that will be loaded, found in the `hydra_configs/conf/` subfolder of each task. You can specify a different blueprint in a YAML file and use that YAML file to run your task (see below). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -6,7 +6,7 @@ This task will collect conversations between a human and a model. After each res | |||
|
|||
## Launching | |||
|
|||
Call `run.py` to run this task with the default parameters, as set by `conf/example.yaml`. Some parameters that you can adjust include where to save data, lists of workers to soft-block, the maximum response time, etc. | |||
Call `run.py` to run this task with the default parameters, as set by `hydra_configs/conf/example.yaml`. Some parameters that you can adjust include where to save data, lists of workers to soft-block, the maximum response time, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good catch
@@ -26,7 +26,7 @@ In `worlds.py`, modify `ModelChatOnboardWorld.check_onboarding_answers()` to cha | |||
|
|||
## Human+model image chat | |||
|
|||
`run_image_chat.py` can be run to chat with a model about an image: each conversation will begin with a selected image, and then the human and model will chat about it. | |||
Call `run.py conf=example_image_chat` to chat with a model about an image: each conversation will begin with a selected image, and then the human and model will chat about it. This task is run with the parameters defined in `hydra_configs/conf/example_image_chat.yaml`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for fixing the CI check issue :)
Big thanks for catching that!! 👏 |
* ConversationTeacher parent class changed * reformat * [Crowdsourcing] can call blueprints from command line (#4254) * remove unnecessary run scripts * udpate readmes * BB2 handling increase in batch size during dynamic batching (#4238) * ConversationTeacher parent class changed * reformat * changed the teacher, tests are passing * removing 'episode_done' if it exists in the example Co-authored-by: Megan Ung <20617868+meganung@users.noreply.github.com>
Patch description
After hydra upgrade, blueprints can now be specified in yaml files so we don’t need individual run scripts for each blueprint.
parlai/crowdsourcing/tasks/turn_annotations_static/run_in_flight_qa.py
andparlai/crowdsourcing/tasks/model_chat/run_image_chat.py
Updated READMEs of those tasks with 2 blueprints (turn_annotations_static and model_chat) and also the general crowdsourcing README since we can specify a blueprint from the command line.
Testing steps
Ran the crowdsourcing jobs with the single run.py script with the config specified with the non default blueprint.