Linhz commited on
Commit
07f25f4
·
verified ·
1 Parent(s): 8ebe27a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -38,7 +38,7 @@ def question_answering(question):
38
  print(question)
39
  query_sentence = [question]
40
  query_embedding = st.session_state.model_embedding.encode(query_sentence)
41
- k = 10000
42
  D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
43
  answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 512) for i in range(k)]
44
  best_answer = max(answer, key=lambda x: x['score'])
 
38
  print(question)
39
  query_sentence = [question]
40
  query_embedding = st.session_state.model_embedding.encode(query_sentence)
41
+ k = 500
42
  D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
43
  answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 512) for i in range(k)]
44
  best_answer = max(answer, key=lambda x: x['score'])