Penality commited on
Commit
d32b70d
·
verified ·
1 Parent(s): 5c0c836

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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
- with open(metadata_file, "r") as f:
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: