Spaces:
Sleeping
Sleeping
Update app/vectorizer.py
Browse files- app/vectorizer.py +10 -9
app/vectorizer.py
CHANGED
@@ -37,15 +37,16 @@ class Vectorizer:
|
|
37 |
if self.pinecone_index_name not in existing_indexes:
|
38 |
logger.info(f"Creating Pinecone index: {self.pinecone_index_name}")
|
39 |
if self._init_pinecone:
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
49 |
else:
|
50 |
logger.info(f"Pinecone index {self.pinecone_index_name} already exists")
|
51 |
|
|
|
37 |
if self.pinecone_index_name not in existing_indexes:
|
38 |
logger.info(f"Creating Pinecone index: {self.pinecone_index_name}")
|
39 |
if self._init_pinecone:
|
40 |
+
pinecone.delete_index(self.pinecone_index_name)
|
41 |
+
pinecone.create_index(
|
42 |
+
name=self.pinecone_index_name,
|
43 |
+
dimension=768,
|
44 |
+
metric='cosine',
|
45 |
+
spec=ServerlessSpec(
|
46 |
+
cloud="aws",
|
47 |
+
region="us-east-1"
|
48 |
+
)
|
49 |
+
)
|
50 |
else:
|
51 |
logger.info(f"Pinecone index {self.pinecone_index_name} already exists")
|
52 |
|