Mikiko Bazeley commited on
Commit
25c861d
·
1 Parent(s): a23f69d

Changed QDrant to be in-memory to make it simpler

Browse files
Files changed (1) hide show
  1. app.py +8 -19
app.py CHANGED
@@ -63,25 +63,14 @@ hf_embeddings = HuggingFaceEndpointEmbeddings(
63
  huggingfacehub_api_token=HF_TOKEN,
64
  )
65
 
66
- if os.path.exists("./vectorstore"):
67
- vectorstore = Qdrant.from_existing_collection(
68
- embeddings=hf_embeddings,
69
- collection_name="AirBnB_10K",
70
- url="http://localhost:6333",
71
- )
72
- hf_retriever = vectorstore.as_retriever()
73
- print("Loaded Vectorstore")
74
- else:
75
- print("Indexing Files")
76
- os.makedirs("./vectorstore", exist_ok=True)
77
- ### 4. INDEX FILES
78
- ### NOTE: REMEMBER TO BATCH THE DOCUMENTS WITH MAXIMUM BATCH SIZE = 32
79
- vectorstore = Qdrant.from_documents(
80
- split_documents,
81
- hf_embeddings,
82
- location="./local_qdrant",
83
- collection_name="AirBnB_10K",
84
- )
85
 
86
  hf_retriever = vectorstore.as_retriever()
87
 
 
63
  huggingfacehub_api_token=HF_TOKEN,
64
  )
65
 
66
+
67
+ vectorstore = Qdrant.from_documents(
68
+ documents=split_documents,
69
+ embedding_model=hf_embeddings,
70
+ location=":memory:",
71
+ collection_name="AirBnB_10K",
72
+ )
73
+
 
 
 
 
 
 
 
 
 
 
 
74
 
75
  hf_retriever = vectorstore.as_retriever()
76