TheBobBob commited on
Commit
5eeb0d2
·
verified ·
1 Parent(s): 70cde39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -159,9 +159,9 @@ def create_vector_db(final_items):
159
  item2 = str(item)
160
  item_id = f"id_{item2[:45].replace(' ', '_')}"
161
 
162
- existing_documents = db.get(ids=[item_id])
163
 
164
- if not existing_documents: # If the ID does not exist
165
  # Generate the LLM prompt and output
166
  prompt = f"""
167
  Summarize the following segment of Antimony in a clear and concise manner:
@@ -187,6 +187,8 @@ def create_vector_db(final_items):
187
  # Add the result to documents and its corresponding ID to the lists
188
  documents_to_add.append(final_result)
189
  ids_to_add.append(item_id)
 
 
190
 
191
  # Add the new documents to the vector database, if there are any
192
  if documents_to_add:
 
159
  item2 = str(item)
160
  item_id = f"id_{item2[:45].replace(' ', '_')}"
161
 
162
+ item_id_already_created = db.get(item_id)
163
 
164
+ if item_id_already_created is None: # If the ID does not exist
165
  # Generate the LLM prompt and output
166
  prompt = f"""
167
  Summarize the following segment of Antimony in a clear and concise manner:
 
187
  # Add the result to documents and its corresponding ID to the lists
188
  documents_to_add.append(final_result)
189
  ids_to_add.append(item_id)
190
+ else:
191
+ continue
192
 
193
  # Add the new documents to the vector database, if there are any
194
  if documents_to_add: