Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ def load_index_and_embeddings(index_file: str, embeddings_file: str):
|
|
47 |
embeddings = np.load(embeddings_file)
|
48 |
return index, embeddings
|
49 |
|
50 |
-
|
51 |
def search(query: str, index, embeddings: np.ndarray, chunks: list, k: int = 5):
|
52 |
query_vector = model.encode([query])
|
53 |
distances, indices = index.search(query_vector.astype('float32'), k)
|
|
|
47 |
embeddings = np.load(embeddings_file)
|
48 |
return index, embeddings
|
49 |
|
50 |
+
|
51 |
def search(query: str, index, embeddings: np.ndarray, chunks: list, k: int = 5):
|
52 |
query_vector = model.encode([query])
|
53 |
distances, indices = index.search(query_vector.astype('float32'), k)
|