Binaryy commited on
Commit
3c03e49
1 Parent(s): 154ac9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -6,11 +6,12 @@ from splade.models.transformer_rep import Splade
6
  from transformers import AutoTokenizer
7
  from datasets import load_dataset
8
 
9
- pinecone.init(
10
- api_key='884344f6-d820-4bc8-9edf-4157373df452',
11
- environment='gcp-starter'
12
- )
13
- index = pinecone.Index('pubmed-splade')
 
14
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
15
  # check device being run on
16
  if device != 'cuda':
 
6
  from transformers import AutoTokenizer
7
  from datasets import load_dataset
8
 
9
+ import os
10
+ from pinecone import Pinecone
11
+ os.environ['PINECONE_API_KEY'] = '884344f6-d820-4bc8-9edf-4157373df452'
12
+ pc = Pinecone(api_key=os.environ.get('PINECONE_API_KEY'))
13
+ index = pc.Index('pubmed-splade')
14
+
15
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
16
  # check device being run on
17
  if device != 'cuda':