Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -135,8 +135,7 @@ def retrieve_document(query):
|
|
135 |
# Search for the closest document in FAISS index
|
136 |
_, closest_idx = index.search(query_embedding, 1)
|
137 |
|
138 |
-
|
139 |
-
metadata = [json.loads(line) for line in f]
|
140 |
|
141 |
# Check if a relevant document was found
|
142 |
if closest_idx[0][0] == -1 or str(closest_idx[0][0]) not in metadata:
|
|
|
135 |
# Search for the closest document in FAISS index
|
136 |
_, closest_idx = index.search(query_embedding, 1)
|
137 |
|
138 |
+
metadata = metadata_.json()
|
|
|
139 |
|
140 |
# Check if a relevant document was found
|
141 |
if closest_idx[0][0] == -1 or str(closest_idx[0][0]) not in metadata:
|