Update app.py
Browse files
app.py
CHANGED
@@ -186,7 +186,7 @@ def search(query, top_k=2):
|
|
186 |
##### Sematic Search #####
|
187 |
# Encode the query using the bi-encoder and find potentially relevant passages
|
188 |
question_embedding = bi_encoder.encode(query, convert_to_tensor=True)
|
189 |
-
question_embedding = question_embedding.
|
190 |
hits = util.semantic_search(question_embedding, corpus_embeddings, top_k=top_k)
|
191 |
hits = hits[0] # Get the hits for the first query
|
192 |
|
|
|
186 |
##### Sematic Search #####
|
187 |
# Encode the query using the bi-encoder and find potentially relevant passages
|
188 |
question_embedding = bi_encoder.encode(query, convert_to_tensor=True)
|
189 |
+
question_embedding = question_embedding.cpu()
|
190 |
hits = util.semantic_search(question_embedding, corpus_embeddings, top_k=top_k)
|
191 |
hits = hits[0] # Get the hits for the first query
|
192 |
|