Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace cli outputs with tables in docs #836

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm install mephisto-task

The `mephisto-task` project surfaces three React hooks depending on your use case:

1. `useMephisoTask` - Used for static tasks where one-time initial data is enough to power the task. See the example task in `/examples/static_react_task/` for an example project using this hook.
1. `useMephistoTask` - Used for static tasks where one-time initial data is enough to power the task. See the example task in `/examples/static_react_task/` for an example project using this hook.
2. `useMephistoLiveTask` - Used for multi-turn, socket-based tasks, such as a dialogue task. See the example task in `/examples/parlai_chat_task_demo/` for an example project using this hook.
3. `useMephistoRemoteProcedureTask` - Used for static tasks that require access to some remote function on the back-end, for example invoking a back-end model for model-assisted annotation. See the example task in `/examples/remote_procedure/mnist/` for an example project using this hook.

Expand Down
24 changes: 17 additions & 7 deletions docs/web/docs/guides/tutorials/custom_react.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,29 @@ We'll begin by modifying the `SharedStaticTaskState`'s `static_task_data` attrib
```bash
$ mephisto wut blueprint=static_react_task static_task_data


Tasks launched from static blueprints need
a prebuilt javascript bundle containing the task. We suggest building
with our provided useMephistoTask hook.



Additional SharedTaskState args from SharedStaticTaskState, which may be configured in your run script
dest type default help choices required
---------------- ------------------------ --------- --------------------------------------- --------- ----------
static_task_data Iterable[Dict[str, Any]] [] List or generator that returns dicts of None False
task data. Generators can be used for
tasks with lengths that aren't known at
the start of a run, or are otherwise
determined during the run.

Additional Shared TaskState args
╭──────────────────┬────────────────┬─────────┬────────────────────────┬─────────┬──────────╮
│ dest │ type │ default │ help │ choices │ required │
├──────────────────┼────────────────┼─────────┼────────────────────────┼─────────┼──────────┤
│ static_task_data │ Iterable[Dict] │ [] │ List or generator that │ None │ False │
│ │ │ │ returns dicts of task │ │ │
│ │ │ │ data. Generators can │ │ │
│ │ │ │ be used for tasks with │ │ │
│ │ │ │ lengths that aren't │ │ │
│ │ │ │ known at the start of │ │ │
│ │ │ │ a run, or are │ │ │
│ │ │ │ otherwise determined │ │ │
│ │ │ │ during the run. │ │ │
╰──────────────────┴────────────────┴─────────┴────────────────────────┴─────────┴──────────╯
```
This field replaces using the `csv_file` used in the previous tutorial, allowing our run script to specify data directly. React tasks can be run off of `.csv` files as well, if you'd prefer.

Expand Down
110 changes: 79 additions & 31 deletions docs/web/docs/guides/tutorials/first_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,42 +99,90 @@ Mephisto configuration options can be inherited from a number of different locat
```bash
$ mephisto wut architect=local

dest type default help choices required
------------------ ------ --------- -------------------------------------- --------- ----------
server_type str node None None False
server_source_path str ??? Optional path to a prepared server None False
directory containing everything needed
to run a server of the given type.
Overrides server type.
hostname str localhost Addressible location of the server None False
port str 3000 Port to launch the server on None False
Architect Arguments
╭────────────────────┬──────┬───────────┬──────────────────────────────┬─────────┬──────────╮
│ dest │ type │ default │ help │ choices │ required │
├────────────────────┼──────┼───────────┼──────────────────────────────┼─────────┼──────────┤
│ server_type │ str │ node │ None │ None │ False │
├────────────────────┼──────┼───────────┼──────────────────────────────┼─────────┼──────────┤
│ server_source_path │ str │ ??? │ Optional path to a prepared │ None │ False │
│ │ │ │ server directory containing │ │ │
│ │ │ │ everything needed to run a │ │ │
│ │ │ │ server of the given type. │ │ │
│ │ │ │ Overrides server type. │ │ │
├────────────────────┼──────┼───────────┼──────────────────────────────┼─────────┼──────────┤
│ hostname │ str │ localhost │ Addressible location of the │ None │ False │
│ │ │ │ server │ │ │
├────────────────────┼──────┼───────────┼──────────────────────────────┼─────────┼──────────┤
│ port │ str │ 3000 │ Port to launch the server on │ None │ False │
╰────────────────────┴──────┴───────────┴──────────────────────────────┴─────────┴──────────╯
```

**For the blueprint:**
```bash
$ mephisto wut blueprint=static_task
Tasks launched from static blueprints need a source html file to display to workers, as well as a csv containing values that will be inserted into templates in the html.
dest type default help choices required
------------------------ ------- --------- ---------------------------------------- --------- ----------
block_qualification str ??? Specify the name of a qualification used None False
to soft block workers.
onboarding_qualification str ??? Specify the name of a qualification used None False
to block workers who fail onboarding,
Empty will skip onboarding.
units_per_assignment int 1 How many workers you want to do each None False
assignment
extra_source_dir str ??? Optional path to sources that the HTML None False
may refer to (such as
images/video/css/scripts)
data_json str ??? Path to JSON file containing task data None False
data_jsonl str ??? Path to JSON-L file containing task data None False
data_csv str ??? Path to csv file containing task data None False
task_source str ??? Path to source HTML file for the task None True
being run
preview_source unknown ??? Optional path to source HTML file to None False
preview the task
onboarding_source unknown ??? Optional path to source HTML file to None False
onboarding the task
Tasks launched from static blueprints need a source html file to display to workers,
as well as a csv containing values that will be inserted into templates in the html.

Blueprint Arguments
╭───────────────────┬─────────┬────────────────────┬───────────────────┬─────────┬──────────╮
│ dest │ type │ default │ help │ choices │ required │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ block_qualificat… │ str │ ??? │ Specify the name │ None │ False │
│ │ │ │ of a │ │ │
│ │ │ │ qualification │ │ │
│ │ │ │ used to soft │ │ │
│ │ │ │ block workers. │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ tips_location │ str │ /Users/etesam1/Do… │ Path to csv file │ None │ False │
│ │ │ │ containing tips │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ onboarding_quali… │ str │ ??? │ Specify the name │ None │ False │
│ │ │ │ of a │ │ │
│ │ │ │ qualification │ │ │
│ │ │ │ used to block │ │ │
│ │ │ │ workers who fail │ │ │
│ │ │ │ onboarding, Empty │ │ │
│ │ │ │ will skip │ │ │
│ │ │ │ onboarding. │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ units_per_assign… │ int │ 1 │ How many workers │ None │ False │
│ │ │ │ you want to do │ │ │
│ │ │ │ each assignment │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ extra_source_dir │ str │ ??? │ Optional path to │ None │ False │
│ │ │ │ sources that the │ │ │
│ │ │ │ HTML may refer to │ │ │
│ │ │ │ (such as │ │ │
│ │ │ │ images/video/css… │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ data_json │ str │ ??? │ Path to JSON file │ None │ False │
│ │ │ │ containing task │ │ │
│ │ │ │ data │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ data_jsonl │ str │ ??? │ Path to JSON-L │ None │ False │
│ │ │ │ file containing │ │ │
│ │ │ │ task data │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ data_csv │ str │ ??? │ Path to csv file │ None │ False │
│ │ │ │ containing task │ │ │
│ │ │ │ data │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ task_source │ str │ ??? │ Path to source │ None │ True │
│ │ │ │ HTML file for the │ │ │
│ │ │ │ task being run │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ preview_source │ unknown │ ??? │ Optional path to │ None │ False │
│ │ │ │ source HTML file │ │ │
│ │ │ │ to preview the │ │ │
│ │ │ │ task │ │ │
├───────────────────┼─────────┼────────────────────┼───────────────────┼─────────┼──────────┤
│ onboarding_source │ unknown │ ??? │ Optional path to │ None │ False │
│ │ │ │ source HTML file │ │ │
│ │ │ │ to onboarding the │ │ │
│ │ │ │ task │ │ │
╰───────────────────┴─────────┴────────────────────┴───────────────────┴─────────┴──────────╯

Additional SharedTaskState args from SharedStaticTaskState
# ... snipped ...
```
Expand Down