tdecae commited on
Commit
d8d68aa
1 Parent(s): b464b4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -120,7 +120,7 @@ embeddings = embedding_model.encode(texts).tolist() # Convert numpy arrays to l
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], [embedding])
124
  vectorstore.persist()
125
 
126
  # Load the Hugging Face model for text generation
@@ -178,3 +178,4 @@ demo.launch(debug=True)
178
 
179
 
180
 
 
 
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
 
178
 
179
 
180
 
181
+