Spaces:
Paused
Paused
Mikiko Bazeley
commited on
Commit
·
25c861d
1
Parent(s):
a23f69d
Changed QDrant to be in-memory to make it simpler
Browse files
app.py
CHANGED
@@ -63,25 +63,14 @@ hf_embeddings = HuggingFaceEndpointEmbeddings(
|
|
63 |
huggingfacehub_api_token=HF_TOKEN,
|
64 |
)
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
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 |
|