LukeOLuck commited on
Commit
91f8084
1 Parent(s): 5f55acc

stop using zip

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -60,9 +60,9 @@ def predict(text) -> Tuple[Dict, float]:
60
 
61
  # Get actual response
62
  actual_response = None
63
- for question, answer in zip(questions_texts, answers_texts):
64
  if text.strip() == question.strip():
65
- actual_response = answer
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