Tristan Thrush commited on
Commit
1ad7202
1 Parent(s): a868cbd
Files changed (2) hide show
  1. app.py +1 -4
  2. collect.py +1 -2
app.py CHANGED
@@ -64,16 +64,13 @@ 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
- 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(
 
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/externalSubmit"
70
  x = requests.post(url, data=state)
 
71
  print(x)
72
  #print(x.text)
73
+ return str(x) + " With assignmentId " + state["assignmentId"][0] + "\n" + x.text, state, dummy
74
 
75
  # Button event handlers
76
  submit_ex_button.click(
collect.py CHANGED
@@ -18,11 +18,10 @@ mturk = boto3.client(
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
 
25
- #<gradio-app space="Tristan/dadc/+?assignmentID=3UAU495MJU632HGLO12HZWVGBUDUOM"></gradio-app>
26
  new_hit = mturk.create_hit(
27
  Title="DADC with Gradio",
28
  Description="Hello world",
 
18
  )
19
 
20
  # The + in the URL makes the Space easily embeddable in an iframe
21
+ question = ExternalQuestion("https://hf.space/embed/Tristan/dadc/+?__theme=light",
22
  frame_height=600
23
  )
24
 
 
25
  new_hit = mturk.create_hit(
26
  Title="DADC with Gradio",
27
  Description="Hello world",