Zethearc commited on
Commit
18d13ab
1 Parent(s): 8b34458

Create pinecone.py

Browse files
Files changed (1) hide show
  1. pinecone.py +12 -0
pinecone.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import pinecone
3
+ from sentence_transformers import SentenceTransformer
4
+
5
+ model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
6
+
7
+ # get API key from app.pinecone.io and environment from console
8
+ pinecone.init(
9
+ api_key= os.environ.get('PINECONE_API_KEY'),
10
+ environment= os.environ.get('PINECONE_ENVIROMENT')
11
+ )
12
+ index = pinecone.Index('edu-ai-indexes')