Spaces:
Running
Running
“vinit5112”
commited on
Commit
·
0972444
1
Parent(s):
3c3bbd6
collections issue
Browse files- backend/vector_store.py +4 -4
backend/vector_store.py
CHANGED
@@ -14,8 +14,8 @@ load_dotenv()
|
|
14 |
logger = logging.getLogger(__name__)
|
15 |
|
16 |
class VectorStore:
|
17 |
-
def __init__(self
|
18 |
-
self.collection_name =
|
19 |
|
20 |
# Get Qdrant configuration from environment variables
|
21 |
qdrant_url = os.getenv("QDRANT_URL")
|
@@ -122,7 +122,7 @@ class VectorStore:
|
|
122 |
# Check if collection exists
|
123 |
collections = self.client.get_collections()
|
124 |
collection_names = [col.name for col in collections.collections]
|
125 |
-
|
126 |
if self.collection_name in collection_names:
|
127 |
print(f"Collection '{self.collection_name}' already exists")
|
128 |
return True
|
@@ -130,7 +130,7 @@ class VectorStore:
|
|
130 |
print(f"Creating new collection: {self.collection_name}")
|
131 |
|
132 |
# Vector size for all-MiniLM-L6-v2 is 384
|
133 |
-
vector_size =
|
134 |
|
135 |
# Create collection with vector configuration
|
136 |
self.client.create_collection(
|
|
|
14 |
logger = logging.getLogger(__name__)
|
15 |
|
16 |
class VectorStore:
|
17 |
+
def __init__(self):
|
18 |
+
self.collection_name = "ca_documents"
|
19 |
|
20 |
# Get Qdrant configuration from environment variables
|
21 |
qdrant_url = os.getenv("QDRANT_URL")
|
|
|
122 |
# Check if collection exists
|
123 |
collections = self.client.get_collections()
|
124 |
collection_names = [col.name for col in collections.collections]
|
125 |
+
print("list of collections : ", collection_names)
|
126 |
if self.collection_name in collection_names:
|
127 |
print(f"Collection '{self.collection_name}' already exists")
|
128 |
return True
|
|
|
130 |
print(f"Creating new collection: {self.collection_name}")
|
131 |
|
132 |
# Vector size for all-MiniLM-L6-v2 is 384
|
133 |
+
vector_size = 384
|
134 |
|
135 |
# Create collection with vector configuration
|
136 |
self.client.create_collection(
|