Spaces:
Runtime error
Runtime error
Tristan Thrush
commited on
Commit
•
e3e024d
1
Parent(s):
0b9ecb2
bugfix
Browse files
app.py
CHANGED
@@ -56,7 +56,6 @@ with demo:
|
|
56 |
ret += " You fooled the model! Well done!"
|
57 |
else:
|
58 |
ret += " You did not fool the model! Too bad, try again!"
|
59 |
-
state["data"].append({"cnt": state["cnt"], "text": txt, "target": tgt, "model_pred": pred["label"], "fooled": fooled})
|
60 |
state["cnt"] += 1
|
61 |
|
62 |
done = state["cnt"] == total_cnt
|
@@ -64,6 +63,8 @@ with demo:
|
|
64 |
toggle_example_submit = gr.update(visible=not done)
|
65 |
new_state_md = f"State: {state['cnt']}/{total_cnt} ({state['cnt_fooled']} fooled)"
|
66 |
|
|
|
|
|
67 |
query = parse_qs(dummy[1:])
|
68 |
if "assignmentId" in query:
|
69 |
# It seems that someone is using this app on mturk. We need to
|
|
|
56 |
ret += " You fooled the model! Well done!"
|
57 |
else:
|
58 |
ret += " You did not fool the model! Too bad, try again!"
|
|
|
59 |
state["cnt"] += 1
|
60 |
|
61 |
done = state["cnt"] == total_cnt
|
|
|
63 |
toggle_example_submit = gr.update(visible=not done)
|
64 |
new_state_md = f"State: {state['cnt']}/{total_cnt} ({state['cnt_fooled']} fooled)"
|
65 |
|
66 |
+
state["data"].append({"cnt": state["cnt"], "text": txt, "target": tgt, "model_pred": pred["label"], "fooled": fooled})
|
67 |
+
|
68 |
query = parse_qs(dummy[1:])
|
69 |
if "assignmentId" in query:
|
70 |
# It seems that someone is using this app on mturk. We need to
|