You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/web/docs/guides/tutorials/first_task.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ To get started, you can launch a task by executing a run script. For instance, l
20
20
21
21
```bash
22
22
$ cd examples/simple_static_task
23
-
$ python static_test_script.py
23
+
$ python run_task.py
24
24
```
25
25
26
26
This will launch a local HTTP server with the task hosted, based on the default configuration options:
@@ -31,21 +31,21 @@ defaults:
31
31
- /mephisto/architect: local
32
32
- /mephisto/provider: mock
33
33
```
34
-
We'll dig into *how* this works [later](#33-default-abstraction-usage).
34
+
We'll dig into *how* this works [later](#33-default-abstraction-usage).
35
35
36
36
### 1.2 Access the task
37
37
38
38
By default, the task should be hosted at `localhost:3000`. This default is set by the `LocalArchitect`, which is used based on the `- /mephisto/architect: local` line above. Navigating to this address should show you the preview view for the task.
39
39
40
-
Actually being able to access this task is done by providing `worker_id` and `assignment_id` URL params, like `localhost:3000/?worker_id=x&assignment_id=1` The `MockProvider` interprets these to be a test worker, which you can use to try out tasks.
40
+
Actually being able to access this task is done by providing `worker_id` and `assignment_id` URL params, like `localhost:3000/?worker_id=x&assignment_id=1` The `MockProvider` interprets these to be a test worker, which you can use to try out tasks.
41
41
42
42
Try navigating here and completing a task by selecting a value (no need to use the file upload). After hitting submit you'll note that the window alerts you to the data that was sent to the Mephisto backend.
43
43
44
44
To work on another task, you'll want to change the `assignment_id` in your url. This will let `Worker` "x" work on another task. Complete and submit this too.
45
45
46
46
If you try to work on another task, you'll note that the system states you've worked on the maximum number of tasks. On this task, this is because Mephisto has launched the same two tasks twice to attempt to get different workers to complete them, and as "x" you've already completed both tasks. More on this [later.](#unit-creation-explained)
47
47
48
-
If you change to another `worker_id`, however, you can complete two more tasks. Do this and the Mephisto process should shut down cleanly.
48
+
If you change to another `worker_id`, however, you can complete two more tasks. Do this and the Mephisto process should shut down cleanly.
49
49
50
50
51
51
### 1.3 Reviewing tasks
@@ -60,24 +60,24 @@ For your convenience, for the `html-static-task-example` task we've already prov
60
60
$ python examine_results.py
61
61
Do you want to (r)eview, or (e)xamine data? Default examine. Can put e <end> or e <start> <end> to choose how many to view
62
62
>> r
63
-
Input task name:
63
+
Input task name:
64
64
```
65
65
66
66
Here we can enter the default task name for this task, `html-static-task-example` to see the results. You can also leave the two qualifications blank, as we aren't dealing with these yet.
67
67
68
68
```
69
69
Input task name: html-static-task-example
70
70
If you'd like to soft-block workers, you'll need a block qualification. Leave blank otherwise.
71
-
Enter block qualification:
71
+
Enter block qualification:
72
72
If you'd like to qualify high-quality workers, you'll need an approve qualification. Leave blank otherwise.
73
-
Enter approve qualification:
73
+
Enter approve qualification:
74
74
Starting review with following params:
75
75
Task name: html-static-task-example
76
76
Blocking qualification: None
77
77
Approve qualification: None
78
-
Press enter to continue...
78
+
Press enter to continue...
79
79
```
80
-
After pressing enter, you'll be able to take action on some of the incoming tasks. You can `(a)ccept, (r)eject, (p)ass` using `a`, `r`, or `p`, using the caps version to apply to all the `Unit`s for a specific worker. Passing is used for work you think was attempted legitimately, but may have not been done
80
+
After pressing enter, you'll be able to take action on some of the incoming tasks. You can `(a)ccept, (r)eject, (p)ass` using `a`, `r`, or `p`, using the caps version to apply to all the `Unit`s for a specific worker. Passing is used for work you think was attempted legitimately, but may have not been done
81
81
```
82
82
Reviewing for worker x, (1/2), Previous (First time worker!) (total remaining: 4)
83
83
-------------------
@@ -105,7 +105,7 @@ Mephisto configuration options can be inherited from a number of different locat
@@ -199,7 +199,7 @@ For our given example task, the values we are using for these options are availa
199
199
200
200
As a simple starting point, we can try launching the server on a different port. Right now the default is `3000`, but with the following command we can set that ourselves:
This should launch the same task, but now available on the port `1234` rather than `3000`.
@@ -237,7 +237,7 @@ mephisto:
237
237
238
238
Save this configuration file, and you're ready to launch again:
239
239
```bash
240
-
$ python static_test_script.py conf=my_config
240
+
$ python run_task.py conf=my_config
241
241
```
242
242
You'll note that Mephisto launches the task under your new task name:
243
243
```
@@ -282,7 +282,7 @@ mephisto:
282
282
```
283
283
Save this configuration file, and you're ready to see your task live:
284
284
```bash
285
-
$ python static_test_script.py conf=my_config
285
+
$ python run_task.py conf=my_config
286
286
```
287
287
Mephisto should print out a link to view your task on the mturk sandbox, like `https://workersandbox.mturk.com/mturk/preview?groupId=XXXXXXXXXXXXXXXX`. Navigate here and you're working on the same task, available on MTurk (on the sandbox at least)!
288
288
@@ -292,13 +292,13 @@ Complete this task, and you can review it in the same way as before.
292
292
293
293
## 3. Task breakdown
294
294
295
-
Now that you've gotten a task running, this section gives a quick overview on some of the components in the configs and `static_test_script.py` that led to the observed behaviors. The goal is to ensure you can write your own run files by the end of the tutorial sections.
295
+
Now that you've gotten a task running, this section gives a quick overview on some of the components in the configs and `run_task.py` that led to the observed behaviors. The goal is to ensure you can write your own run files by the end of the tutorial sections.
296
296
297
297
### 3.1 Config registration
298
-
Mephisto wires up to configuration using standard Hydra syntax, but with both `yaml` files (for ease of writing) _and_ structured configs (for ease of documentation).
298
+
Mephisto wires up to configuration using standard Hydra syntax, but with both `yaml` files (for ease of writing) _and_ structured configs (for ease of documentation).
299
299
Here's the config we've set up for this example:
300
300
```python
301
-
#static_test_script.py
301
+
#run_task.py
302
302
from mephisto.abstractions.blueprints.static_html_task.static_html_blueprint import (
303
303
BLUEPRINT_TYPE_STATIC_HTML,
304
304
)
@@ -312,7 +312,7 @@ This is all you really *need* to launch a Mephisto task! The `@task_script` deco
312
312
313
313
Of course, there's quite a bit of 'magic' happening underneath the hood thanks to the script utilities. This version is explicit to show where you may add customization, and re-ordered for understanding:
314
314
```python
315
-
# modified static_test_script.py
315
+
# modified run_task.py
316
316
from mephisto.abstractions.blueprints.static_html_task.static_html_blueprint import (
0 commit comments