ababio commited on
Commit
33bf624
1 Parent(s): 6f298fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -22,6 +22,11 @@ client = OpenAI(api_key=openai_api_key)
22
  # Initialize connection to Pinecone
23
  pc = PineconeGRPC(api_key=pinecone_api_key)
24
 
 
 
 
 
 
25
  pinecone_index = pc.Index(index_name)
26
 
27
  # Initialize VectorStore
 
22
  # Initialize connection to Pinecone
23
  pc = PineconeGRPC(api_key=pinecone_api_key)
24
 
25
+ # Initialize your index
26
+ if index_name not in pc.list_indexes():
27
+ spec = ServerlessSpec(replicas=1, pod_type="p1")
28
+ pc.create_index(name=index_name, dimension=1536, spec=spec)
29
+
30
  pinecone_index = pc.Index(index_name)
31
 
32
  # Initialize VectorStore