Tristan Thrush commited on
Commit
80bfae7
1 Parent(s): 1ad7202
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -17,7 +17,7 @@ with demo:
17
  dummy = gr.Textbox(visible=False) # dummy for passing assignmentId
18
 
19
  # We keep track of state as a Variable
20
- state_dict = {"assignmentId": "", "cnt": 0, "fooled": 0, "data": [], "metadata": {}, "response": ""}
21
  state = gr.Variable(state_dict)
22
 
23
  gr.Markdown("# DADC in Gradio example")
@@ -67,9 +67,7 @@ with demo:
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
 
17
  dummy = gr.Textbox(visible=False) # dummy for passing assignmentId
18
 
19
  # We keep track of state as a Variable
20
+ state_dict = {"assignmentId": "", "cnt": 0, "fooled": 0, "data": [], "metadata": {}}
21
  state = gr.Variable(state_dict)
22
 
23
  gr.Markdown("# DADC in Gradio example")
 
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.value)
 
 
71
  return str(x) + " With assignmentId " + state["assignmentId"][0] + "\n" + x.text, state, dummy
72
 
73
  # Button event handlers