TheBobBob commited on
Commit
62dd843
·
verified ·
1 Parent(s): 406c3a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -139,11 +139,12 @@ def create_vector_db(final_items):
139
  try:
140
  db = client.create_collection(
141
  name=collection_name,
142
- metadata={"hnsw:space": "cosine"}
 
143
  )
144
  except UniqueConstraintError:
145
  print(f"Collection '{collection_name}' already exists.")
146
- collection = db.get_collection(name=collection_name)
147
 
148
  documents = []
149
 
 
139
  try:
140
  db = client.create_collection(
141
  name=collection_name,
142
+ metadata={"hnsw:space": "cosine"},
143
+ embeddding_function = "all-MiniLM-L6-v2"
144
  )
145
  except UniqueConstraintError:
146
  print(f"Collection '{collection_name}' already exists.")
147
+ db = db.get_collection(name=collection_name, embedding_function = "all-MiniLM-L6-v2")
148
 
149
  documents = []
150