Spaces:
Configuration error
Configuration error
Tristan Thrush
commited on
Commit
Β·
1dada23
1
Parent(s):
dba1334
fixed saving bug
Browse files
app.py
CHANGED
@@ -97,6 +97,8 @@ with demo:
|
|
97 |
|
98 |
def _select_response(selected_response, state, dummy):
|
99 |
done = state["cnt"] == TOTAL_CNT
|
|
|
|
|
100 |
if state["cnt"] == TOTAL_CNT:
|
101 |
# Write the HIT data to our local dataset because the worker has
|
102 |
# submitted everything now.
|
@@ -105,8 +107,6 @@ with demo:
|
|
105 |
[json.dumps(dict({"assignmentId": state["assignmentId"], "conversation_id": state["conversation_id"]}, **datum)) for datum in state["data"]]
|
106 |
jsonlfile.write("\n".join(json_data_with_assignment_id) + "\n")
|
107 |
toggle_example_submit = gr.update(visible=not done)
|
108 |
-
state["generated_responses"].append(selected_response)
|
109 |
-
state["data"][-1]["selected_response"] = selected_response
|
110 |
past_conversation_string = "<br />".join(["<br />".join(["π: " + user_input, "π€: " + model_response]) for user_input, model_response in zip(state["past_user_inputs"], state["generated_responses"])])
|
111 |
query = parse_qs(dummy[1:])
|
112 |
if "assignmentId" in query and query["assignmentId"][0] != "ASSIGNMENT_ID_NOT_AVAILABLE":
|
|
|
97 |
|
98 |
def _select_response(selected_response, state, dummy):
|
99 |
done = state["cnt"] == TOTAL_CNT
|
100 |
+
state["generated_responses"].append(selected_response)
|
101 |
+
state["data"][-1]["selected_response"] = selected_response
|
102 |
if state["cnt"] == TOTAL_CNT:
|
103 |
# Write the HIT data to our local dataset because the worker has
|
104 |
# submitted everything now.
|
|
|
107 |
[json.dumps(dict({"assignmentId": state["assignmentId"], "conversation_id": state["conversation_id"]}, **datum)) for datum in state["data"]]
|
108 |
jsonlfile.write("\n".join(json_data_with_assignment_id) + "\n")
|
109 |
toggle_example_submit = gr.update(visible=not done)
|
|
|
|
|
110 |
past_conversation_string = "<br />".join(["<br />".join(["π: " + user_input, "π€: " + model_response]) for user_input, model_response in zip(state["past_user_inputs"], state["generated_responses"])])
|
111 |
query = parse_qs(dummy[1:])
|
112 |
if "assignmentId" in query and query["assignmentId"][0] != "ASSIGNMENT_ID_NOT_AVAILABLE":
|