Spaces:
Runtime error
Runtime error
Commit
Β·
d4b020e
1
Parent(s):
62dae98
Update app.py
Browse files
app.py
CHANGED
@@ -74,8 +74,15 @@ def enhance_image(pil_image):
|
|
74 |
return enhanced_pil_image
|
75 |
|
76 |
|
|
|
77 |
if INDEX_NAME not in pinecone.list_indexes():
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
print("Connecting to Pinecone Index")
|
81 |
index = pinecone.Index(INDEX_NAME)
|
|
|
74 |
return enhanced_pil_image
|
75 |
|
76 |
|
77 |
+
print("checking pinecone Index")
|
78 |
if INDEX_NAME not in pinecone.list_indexes():
|
79 |
+
# delete the current index and create the new index if it does not exist
|
80 |
+
for delete_index in pinecone.list_indexes():
|
81 |
+
print(f"Deleting exitsing pinecone Index : {delete_index}")
|
82 |
+
|
83 |
+
pinecone.delete_index(delete_index)
|
84 |
+
print(f"Creating new pinecone Index : {INDEX_NAME}")
|
85 |
+
pinecone.create_index(INDEX_NAME, dimension=INDEX_DIMENSION, metric="cosine")
|
86 |
|
87 |
print("Connecting to Pinecone Index")
|
88 |
index = pinecone.Index(INDEX_NAME)
|