tdecae commited on
Commit
53a8189
1 Parent(s): d8d68aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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=[{"embedding": embedding}])
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
+