pull/96/head
Alex 1 year ago
parent f69bcb1675
commit 842d347e5e

@ -141,17 +141,17 @@ def check_docs():
if os.path.exists(vectorstore): if os.path.exists(vectorstore):
return {"status": 'exists'} return {"status": 'exists'}
else: else:
r = requests.get(base_path + vectorstore + "docs.index") r = requests.get(base_path + vectorstore + "index.faiss")
# save to vectors directory # save to vectors directory
# check if the directory exists # check if the directory exists
if not os.path.exists(vectorstore): if not os.path.exists(vectorstore):
os.makedirs(vectorstore) os.makedirs(vectorstore)
with open(vectorstore + "docs.index", "wb") as f: with open(vectorstore + "index.faiss", "wb") as f:
f.write(r.content) f.write(r.content)
# download the store # download the store
r = requests.get(base_path + vectorstore + "faiss_store.pkl") r = requests.get(base_path + vectorstore + "index.pkl")
with open(vectorstore + "faiss_store.pkl", "wb") as f: with open(vectorstore + "index.pkl", "wb") as f:
f.write(r.content) f.write(r.content)
return {"status": 'loaded'} return {"status": 'loaded'}

Loading…
Cancel
Save