pyamath commited on
Commit
ef32437
1 Parent(s): d6dd9d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -23,7 +23,7 @@ def chat(user_msg):
23
  query_embedding = model.encode(user_msg, convert_to_tensor=True)
24
  cos_scores = util.cos_sim(query_embedding , corpus_embeddings)
25
  top_results = torch.topk(cos_scores, k=1)
26
- return model_df["question"][top_results[1][0].item()],top_results[0][0].item()
27
  # return top_results[0][0],top_results[1][0]
28
 
29
  # iface = gr.Interface(fn=chat, inputs="text", outputs="text")
 
23
  query_embedding = model.encode(user_msg, convert_to_tensor=True)
24
  cos_scores = util.cos_sim(query_embedding , corpus_embeddings)
25
  top_results = torch.topk(cos_scores, k=1)
26
+ return model_df["answer"][top_results[1][0].item()],top_results[0][0].item()
27
  # return top_results[0][0],top_results[1][0]
28
 
29
  # iface = gr.Interface(fn=chat, inputs="text", outputs="text")