Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,6 +59,7 @@ def search():
|
|
| 59 |
query = st_text_area
|
| 60 |
##### Sematic Search #####
|
| 61 |
# Encode the query using the bi-encoder and find potentially relevant passages
|
|
|
|
| 62 |
question_embedding = bi_encoder.encode(query, convert_to_tensor=True)
|
| 63 |
hits = util.semantic_search(question_embedding, wikipedia_embedding, top_k=top_k)
|
| 64 |
hits = hits[0] # Get the hits for the first query
|
|
|
|
| 59 |
query = st_text_area
|
| 60 |
##### Sematic Search #####
|
| 61 |
# Encode the query using the bi-encoder and find potentially relevant passages
|
| 62 |
+
top_k = 32
|
| 63 |
question_embedding = bi_encoder.encode(query, convert_to_tensor=True)
|
| 64 |
hits = util.semantic_search(question_embedding, wikipedia_embedding, top_k=top_k)
|
| 65 |
hits = hits[0] # Get the hits for the first query
|