Spaces:
Runtime error
Runtime error
Changed parameter type hinting.
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def load_knowledge_base_index():
|
|
24 |
return index
|
25 |
|
26 |
|
27 |
-
def vector_search(query: list
|
28 |
vector = model.encode(list(query), show_progress_bar=False, convert_to_numpy=True)
|
29 |
D, I = index.search(np.array(vector).astype("float32"), k=num_results)
|
30 |
return D, I
|
|
|
24 |
return index
|
25 |
|
26 |
|
27 |
+
def vector_search(query: list, model: SentenceTransformer, index, num_results=10):
|
28 |
vector = model.encode(list(query), show_progress_bar=False, convert_to_numpy=True)
|
29 |
D, I = index.search(np.array(vector).astype("float32"), k=num_results)
|
30 |
return D, I
|