Spaces:
Sleeping
Sleeping
Commit
•
71c760e
1
Parent(s):
9ad1d3a
fix bugs
Browse files- backend.py +5 -3
backend.py
CHANGED
@@ -266,7 +266,8 @@ class Backend:
|
|
266 |
self.text = self.text_list[self.current_passage]
|
267 |
gpt_res = self.res_list[self.current_passage]
|
268 |
self.gpt_result = gpt_res
|
269 |
-
res = self.gpt_result[f'Question {self.current_question + 1}']
|
|
|
270 |
question = self.questions[self.current_question]
|
271 |
self.answer = res['answer']
|
272 |
self.highlighted_out = res['original sentences']
|
@@ -293,7 +294,8 @@ class Backend:
|
|
293 |
self.text = self.text_list[self.current_passage]
|
294 |
gpt_res = self.res_list[self.current_passage]
|
295 |
self.gpt_result = gpt_res
|
296 |
-
res = self.gpt_result[f'Question {self.current_question + 1}']
|
|
|
297 |
question = self.questions[self.current_question]
|
298 |
self.answer = res['answer']
|
299 |
self.highlighted_out = res['original sentences']
|
@@ -514,7 +516,7 @@ class Backend:
|
|
514 |
self.answer_df = pd.concat([tmp, self.answer_df])
|
515 |
|
516 |
# default fist question
|
517 |
-
gpt_res = gpt_res[
|
518 |
question = self.questions[self.current_question]
|
519 |
self.answer = gpt_res['answer']
|
520 |
self.text = self.text_list[0]
|
|
|
266 |
self.text = self.text_list[self.current_passage]
|
267 |
gpt_res = self.res_list[self.current_passage]
|
268 |
self.gpt_result = gpt_res
|
269 |
+
# res = self.gpt_result[f'Question {self.current_question + 1}']
|
270 |
+
res = self.gpt_result[list(self.gpt_result.keys())[self.current_question]]
|
271 |
question = self.questions[self.current_question]
|
272 |
self.answer = res['answer']
|
273 |
self.highlighted_out = res['original sentences']
|
|
|
294 |
self.text = self.text_list[self.current_passage]
|
295 |
gpt_res = self.res_list[self.current_passage]
|
296 |
self.gpt_result = gpt_res
|
297 |
+
# res = self.gpt_result[f'Question {self.current_question + 1}']
|
298 |
+
res = self.gpt_result[list(self.gpt_result.keys())[self.current_question]]
|
299 |
question = self.questions[self.current_question]
|
300 |
self.answer = res['answer']
|
301 |
self.highlighted_out = res['original sentences']
|
|
|
516 |
self.answer_df = pd.concat([tmp, self.answer_df])
|
517 |
|
518 |
# default fist question
|
519 |
+
gpt_res = gpt_res[list(gpt_res.keys())[0]]
|
520 |
question = self.questions[self.current_question]
|
521 |
self.answer = gpt_res['answer']
|
522 |
self.text = self.text_list[0]
|