Spaces:
Runtime error
Runtime error
Tristan Thrush
commited on
Commit
•
a868cbd
1
Parent(s):
e22cf04
debug
Browse files- app.py +3 -3
- collect.py +2 -8
app.py
CHANGED
@@ -65,15 +65,15 @@ with demo:
|
|
65 |
def _submit(state, dummy):
|
66 |
query = parse_qs(dummy[1:])
|
67 |
print('yo')
|
68 |
-
assert "
|
69 |
print('yo2')
|
70 |
-
state["assignmentId"] = query["
|
71 |
url = "https://workersandbox.mturk.com/mturk/externalSubmit"
|
72 |
x = requests.post(url, data=state)
|
73 |
print('yo3')
|
74 |
print(x)
|
75 |
#print(x.text)
|
76 |
-
return str(x) + " With
|
77 |
|
78 |
# Button event handlers
|
79 |
submit_ex_button.click(
|
|
|
65 |
def _submit(state, dummy):
|
66 |
query = parse_qs(dummy[1:])
|
67 |
print('yo')
|
68 |
+
assert "assignmentId" in query, "No assignment ID provided, unable to submit"
|
69 |
print('yo2')
|
70 |
+
state["assignmentId"] = query["assignmentId"]
|
71 |
url = "https://workersandbox.mturk.com/mturk/externalSubmit"
|
72 |
x = requests.post(url, data=state)
|
73 |
print('yo3')
|
74 |
print(x)
|
75 |
#print(x.text)
|
76 |
+
return str(x) + " With assignmentId " + state["assignmentId"][0], state, dummy
|
77 |
|
78 |
# Button event handlers
|
79 |
submit_ex_button.click(
|
collect.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# For more information see https://docs.aws.amazon.com/mturk/index.html
|
3 |
|
4 |
import boto3
|
5 |
-
from boto.mturk.question import
|
6 |
|
7 |
from config import MTURK_KEY, MTURK_SECRET
|
8 |
|
@@ -18,13 +18,7 @@ mturk = boto3.client(
|
|
18 |
)
|
19 |
|
20 |
# The + in the URL makes the Space easily embeddable in an iframe
|
21 |
-
question =
|
22 |
-
"""
|
23 |
-
<!DOCTYPE html>
|
24 |
-
<html>
|
25 |
-
<iframe src="https://hf.space/embed/Tristan/dadc/+"></iframe>
|
26 |
-
</html>
|
27 |
-
""",
|
28 |
frame_height=600
|
29 |
)
|
30 |
|
|
|
2 |
# For more information see https://docs.aws.amazon.com/mturk/index.html
|
3 |
|
4 |
import boto3
|
5 |
+
from boto.mturk.question import ExternalQuestion
|
6 |
|
7 |
from config import MTURK_KEY, MTURK_SECRET
|
8 |
|
|
|
18 |
)
|
19 |
|
20 |
# The + in the URL makes the Space easily embeddable in an iframe
|
21 |
+
question = ExternalQuestion("https://hf.space/embed/Tristan/dadc",
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
frame_height=600
|
23 |
)
|
24 |
|