Tristan Thrush commited on
Commit
14d8566
1 Parent(s): 7f6945b
Files changed (2) hide show
  1. app.py +1 -1
  2. collect.py +4 -11
app.py CHANGED
@@ -87,7 +87,7 @@ with demo:
87
  _submit,
88
  inputs=[state, dummy],
89
  outputs=[response_output, state, dummy],
90
- _js="function(state, dummy) { console.log(window); return [state, window.location.search]; }",
91
  )
92
  #gr.Markdown(state["response"].text if "response" in state and state["response"] is not None else "")
93
 
 
87
  _submit,
88
  inputs=[state, dummy],
89
  outputs=[response_output, state, dummy],
90
+ _js="function(state, dummy) { return [state, window.location.search] }",
91
  )
92
  #gr.Markdown(state["response"].text if "response" in state and state["response"] is not None else "")
93
 
collect.py CHANGED
@@ -22,24 +22,15 @@ question = HTMLQuestion(
22
  """
23
  <!DOCTYPE html>
24
  <html>
25
- <head>
26
- <meta charset="utf-8" />
27
- <meta name="viewport" content="width=device-width" />
28
- <title>My static Space</title>
29
- <link rel="shortcut icon" href="#" type="image/x-icon">
30
- <link rel="stylesheet" href="style.css" />
31
- <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
32
- <script type="module" crossorigin src="https://gradio.s3-us-west-2.amazonaws.com/3.0.17/gradio.js"></script>
33
- </head>
34
  <body>
35
- <gradio-app space="Tristan/dadc"></gradio-app>
36
-
37
  </body>
38
  </html>
39
  """,
40
  frame_height=600
41
  )
42
 
 
43
  new_hit = mturk.create_hit(
44
  Title="DADC with Gradio",
45
  Description="Hello world",
@@ -56,3 +47,5 @@ print(
56
  "Sandbox link: https://workersandbox.mturk.com/mturk/preview?groupId="
57
  + new_hit["HIT"]["HITGroupId"]
58
  )
 
 
 
22
  """
23
  <!DOCTYPE html>
24
  <html>
 
 
 
 
 
 
 
 
 
25
  <body>
26
+ <iframe src="https://hf.space/embed/Tristan/dadc/+"></iframe>
 
27
  </body>
28
  </html>
29
  """,
30
  frame_height=600
31
  )
32
 
33
+ #<gradio-app space="Tristan/dadc/+?assignmentID=3UAU495MJU632HGLO12HZWVGBUDUOM"></gradio-app>
34
  new_hit = mturk.create_hit(
35
  Title="DADC with Gradio",
36
  Description="Hello world",
 
47
  "Sandbox link: https://workersandbox.mturk.com/mturk/preview?groupId="
48
  + new_hit["HIT"]["HITGroupId"]
49
  )
50
+
51
+ print("Hit Id:", new_hit["HIT"]["HITId"])