Spaces:
Runtime error
Runtime error
Tristan Thrush
commited on
Commit
•
df77487
1
Parent(s):
5c5d2d9
bugfix
Browse files
app.py
CHANGED
@@ -121,7 +121,7 @@ with demo:
|
|
121 |
|
122 |
post_hit_js = """
|
123 |
function(state) {
|
124 |
-
if (state["assignmentId"] !== ""
|
125 |
// If there is an assignmentId, then the submitter is on mturk
|
126 |
// and has accepted the HIT. So, we need to submit their HIT.
|
127 |
const form = document.createElement('form');
|
@@ -139,8 +139,9 @@ with demo:
|
|
139 |
return state;
|
140 |
} else {
|
141 |
// If there is no assignmentId, then we assume that the submitter is
|
142 |
-
// on huggingface.co
|
143 |
-
//
|
|
|
144 |
// our dataset without an assignmentId. The following line here
|
145 |
// loads the app again so the user can enter in another "fake" HIT.
|
146 |
window.location.href = window.location.href;
|
|
|
121 |
|
122 |
post_hit_js = """
|
123 |
function(state) {
|
124 |
+
if (state["assignmentId"] !== "" && state["assignmentId"] !== "ASSIGNMENT_ID_NOT_AVAILABLE"){
|
125 |
// If there is an assignmentId, then the submitter is on mturk
|
126 |
// and has accepted the HIT. So, we need to submit their HIT.
|
127 |
const form = document.createElement('form');
|
|
|
139 |
return state;
|
140 |
} else {
|
141 |
// If there is no assignmentId, then we assume that the submitter is
|
142 |
+
// on huggingface.co or there is an mturker doing the preview.
|
143 |
+
// This means that we can't log a HIT in mturk, but
|
144 |
+
// _store_in_huggingface_dataset will still store the example in
|
145 |
// our dataset without an assignmentId. The following line here
|
146 |
// loads the app again so the user can enter in another "fake" HIT.
|
147 |
window.location.href = window.location.href;
|