Spaces:
Runtime error
Runtime error
Tristan Thrush
commited on
Commit
·
1d91315
1
Parent(s):
1a555d0
bugfix
Browse files
app.py
CHANGED
|
@@ -93,6 +93,7 @@ with demo:
|
|
| 93 |
with open(DATA_FILE, "a") as jsonlfile:
|
| 94 |
jsonlfile.write(json.dumps(state) + "\n")
|
| 95 |
repo.push_to_hub()
|
|
|
|
| 96 |
|
| 97 |
# Button event handlers
|
| 98 |
get_window_location_search_js = """
|
|
@@ -132,7 +133,7 @@ with demo:
|
|
| 132 |
// _store_in_huggingface_dataset will still store their example in
|
| 133 |
// our dataset without an assignmentId. We call reload() here
|
| 134 |
// to reset the app so the user can enter in another "fake" HIT.
|
| 135 |
-
|
| 136 |
}
|
| 137 |
}
|
| 138 |
"""
|
|
@@ -140,7 +141,7 @@ with demo:
|
|
| 140 |
submit_hit_button.click(
|
| 141 |
_store_in_huggingface_dataset,
|
| 142 |
inputs=[state],
|
| 143 |
-
outputs=
|
| 144 |
_js=post_hit_js,
|
| 145 |
)
|
| 146 |
|
|
|
|
| 93 |
with open(DATA_FILE, "a") as jsonlfile:
|
| 94 |
jsonlfile.write(json.dumps(state) + "\n")
|
| 95 |
repo.push_to_hub()
|
| 96 |
+
return state
|
| 97 |
|
| 98 |
# Button event handlers
|
| 99 |
get_window_location_search_js = """
|
|
|
|
| 133 |
// _store_in_huggingface_dataset will still store their example in
|
| 134 |
// our dataset without an assignmentId. We call reload() here
|
| 135 |
// to reset the app so the user can enter in another "fake" HIT.
|
| 136 |
+
window.location.href = window.location.href;
|
| 137 |
}
|
| 138 |
}
|
| 139 |
"""
|
|
|
|
| 141 |
submit_hit_button.click(
|
| 142 |
_store_in_huggingface_dataset,
|
| 143 |
inputs=[state],
|
| 144 |
+
outputs=[state],
|
| 145 |
_js=post_hit_js,
|
| 146 |
)
|
| 147 |
|