Spaces:
Runtime error
Runtime error
Tristan Thrush
commited on
Commit
•
8c01c8d
1
Parent(s):
3b69f3d
removed favicon
Browse files
app.py
CHANGED
@@ -64,12 +64,9 @@ with demo:
|
|
64 |
# Update the URL below to switch from Sandbox to real data collection
|
65 |
def _submit(state, dummy):
|
66 |
query = parse_qs(dummy[1:])
|
67 |
-
gr.Markdown("trying submit hit")
|
68 |
assert "assignmentId" in query, "No assignment ID provided, unable to submit"
|
69 |
state["assignmentId"] = query["assignmentId"]
|
70 |
url = "https://workersandbox.mturk.com/mturk/htmlSubmit"
|
71 |
-
gr.Markdown(state["assignmentId"])
|
72 |
-
gr.Markdown("Submitting hit")
|
73 |
return requests.post(url, data=state)
|
74 |
|
75 |
# Button event handlers
|
@@ -78,7 +75,6 @@ with demo:
|
|
78 |
inputs=[text_input, label_input, state],
|
79 |
outputs=[label_output, text_output, state, example_submit, final_submit, state_display],
|
80 |
)
|
81 |
-
|
82 |
submit_hit_button.click(
|
83 |
_submit,
|
84 |
inputs=[state, dummy],
|
@@ -86,4 +82,4 @@ with demo:
|
|
86 |
_js="function(state, dummy) { return [state, window.location.search]; }",
|
87 |
)
|
88 |
|
89 |
-
demo.launch(
|
|
|
64 |
# Update the URL below to switch from Sandbox to real data collection
|
65 |
def _submit(state, dummy):
|
66 |
query = parse_qs(dummy[1:])
|
|
|
67 |
assert "assignmentId" in query, "No assignment ID provided, unable to submit"
|
68 |
state["assignmentId"] = query["assignmentId"]
|
69 |
url = "https://workersandbox.mturk.com/mturk/htmlSubmit"
|
|
|
|
|
70 |
return requests.post(url, data=state)
|
71 |
|
72 |
# Button event handlers
|
|
|
75 |
inputs=[text_input, label_input, state],
|
76 |
outputs=[label_output, text_output, state, example_submit, final_submit, state_display],
|
77 |
)
|
|
|
78 |
submit_hit_button.click(
|
79 |
_submit,
|
80 |
inputs=[state, dummy],
|
|
|
82 |
_js="function(state, dummy) { return [state, window.location.search]; }",
|
83 |
)
|
84 |
|
85 |
+
demo.launch()
|