anasmkh commited on
Commit
8bbf95a
·
verified ·
1 Parent(s): 8dfd63d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -37,7 +37,17 @@ else:
37
  documents = []
38
 
39
  # Set up the Qdrant vector store (using an in-memory collection for simplicity)
 
40
  client = qdrant_client.QdrantClient(location=":memory:")
 
 
 
 
 
 
 
 
 
41
  vector_store = QdrantVectorStore(
42
  collection_name="paper",
43
  client=client,
 
37
  documents = []
38
 
39
  # Set up the Qdrant vector store (using an in-memory collection for simplicity)
40
+
41
  client = qdrant_client.QdrantClient(location=":memory:")
42
+ existing_collections = ['paper']
43
+ if collection_name not in existing_collections:
44
+ client.create_collection(
45
+ collection_name='paper',
46
+ vectors_config=models.VectorParams(
47
+ size=1536,
48
+ distance=models.Distance.COSINE
49
+ )
50
+ )
51
  vector_store = QdrantVectorStore(
52
  collection_name="paper",
53
  client=client,