Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -119,8 +119,8 @@ embeddings = embedding_model.encode(texts).tolist() # Convert numpy arrays to l
|
|
119 |
|
120 |
# Create a Chroma vector store and add documents and their embeddings
|
121 |
vectorstore = Chroma(persist_directory="./data")
|
122 |
-
for text, embedding in zip(texts, embeddings):
|
123 |
-
vectorstore.add_texts([text], metadatas=[{"
|
124 |
vectorstore.persist()
|
125 |
|
126 |
# Load the Hugging Face model for text generation
|
@@ -179,3 +179,4 @@ demo.launch(debug=True)
|
|
179 |
|
180 |
|
181 |
|
|
|
|
119 |
|
120 |
# Create a Chroma vector store and add documents and their embeddings
|
121 |
vectorstore = Chroma(persist_directory="./data")
|
122 |
+
for i, (text, embedding) in enumerate(zip(texts, embeddings)):
|
123 |
+
vectorstore.add_texts([text], metadatas=[{"id": i}], embeddings=[embedding])
|
124 |
vectorstore.persist()
|
125 |
|
126 |
# Load the Hugging Face model for text generation
|
|
|
179 |
|
180 |
|
181 |
|
182 |
+
|