stop using zip
Browse files
app.py
CHANGED
@@ -60,9 +60,9 @@ def predict(text) -> Tuple[Dict, float]:
|
|
60 |
|
61 |
# Get actual response
|
62 |
actual_response = None
|
63 |
-
for
|
64 |
if text.strip() == question.strip():
|
65 |
-
actual_response =
|
66 |
break
|
67 |
|
68 |
# Calculate pred time
|
@@ -70,7 +70,7 @@ def predict(text) -> Tuple[Dict, float]:
|
|
70 |
pred_time = round(end_time - start_time, 4)
|
71 |
|
72 |
# Return pred dict and pred time
|
73 |
-
return top_responses, actual_response, pred_time
|
74 |
|
75 |
### 4. Gradio app ###
|
76 |
# Create title, description and article
|
|
|
60 |
|
61 |
# Get actual response
|
62 |
actual_response = None
|
63 |
+
for i, question in enumerate(questions_texts):
|
64 |
if text.strip() == question.strip():
|
65 |
+
actual_response = answers_texts[i]
|
66 |
break
|
67 |
|
68 |
# Calculate pred time
|
|
|
70 |
pred_time = round(end_time - start_time, 4)
|
71 |
|
72 |
# Return pred dict and pred time
|
73 |
+
return {"Top Responses": top_responses}, actual_response, pred_time
|
74 |
|
75 |
### 4. Gradio app ###
|
76 |
# Create title, description and article
|