isayahc commited on
Commit
465bb25
1 Parent(s): a4dffa4

added more to the main example function

Browse files
innovation_pathfinder_ai/vector_store/chroma_vector_store.py CHANGED
@@ -167,11 +167,43 @@ def load_vector_store(
167
  if __name__ == "__main__":
168
 
169
  vector_db = load_vector_store()
170
- # pdf_file_location = "mydir/181000551.pdf"
171
- # pdf_file_location = "/workspaces/InnovationPathfinderAI/2402.17764.pdf"
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  pdf_file_location = "/workspaces/InnovationPathfinderAI/2212.02623.pdf"
173
 
174
  add_pdf_to_vector_store(
175
  collection_name="ArxivPapers",
176
  pdf_file_location=pdf_file_location,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  )
 
167
  if __name__ == "__main__":
168
 
169
  vector_db = load_vector_store()
170
+
171
+ collection_name="ArxivPapers"
172
+
173
+ client = chromadb.PersistentClient(
174
+ # path=persist_directory,
175
+ )
176
+
177
+ # client.delete_collection(
178
+ # name=collection_name,
179
+ # )
180
+
181
+ collection = client.get_or_create_collection(
182
+ name=collection_name,
183
+ )
184
+
185
  pdf_file_location = "/workspaces/InnovationPathfinderAI/2212.02623.pdf"
186
 
187
  add_pdf_to_vector_store(
188
  collection_name="ArxivPapers",
189
  pdf_file_location=pdf_file_location,
190
+ )
191
+
192
+ pdf_file_location = "/workspaces/InnovationPathfinderAI/2402.17764.pdf"
193
+
194
+ add_pdf_to_vector_store(
195
+ collection_name="ArxivPapers",
196
+ pdf_file_location=pdf_file_location,
197
+ )
198
+
199
+ # pdf_file_location = "mydir/181000551.pdf"
200
+ # pdf_file_location = "/workspaces/InnovationPathfinderAI/2402.17764.pdf"
201
+
202
+
203
+ # example query
204
+
205
+ results = collection.query(
206
+ query_texts=["benchmark"],
207
+ n_results=3,
208
+ include=['embeddings', 'documents', 'metadatas'],
209
  )