simonza commited on
Commit
dab872e
·
1 Parent(s): 7466ff9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -11,8 +11,11 @@ import shutil
11
  from PIL import Image
12
  import os
13
 
14
- os.environ["Pinecone_Key"]
15
- os.environ["Google_Translate_Key"]
 
 
 
16
 
17
  with open('pinecone_text.py' ,'w') as fb:
18
  fb.write(requests.get('https://storage.googleapis.com/gareth-pinecone-datasets/pinecone_text.py').text)
@@ -20,7 +23,7 @@ import pinecone_text
20
 
21
  # init connection to pinecone
22
  pinecone.init(
23
- api_key=Pinecone_Key, # app.pinecone.io
24
  environment="asia-southeast1-gcp-free" # find next to api key
25
  )
26
 
@@ -135,7 +138,7 @@ img_files = {'x':[]}
135
  K = 5
136
 
137
  def fake_gan(text, alpha):
138
- detected_language = single_detection(text, api_key=Google_Translate_Key)
139
 
140
  if detected_language == 'iw':
141
  text_eng=GoogleTranslator(source='iw', target='en').translate(text)
 
11
  from PIL import Image
12
  import os
13
 
14
+ PineconeKey = os.environ['Pinecone_Key']
15
+ TranslateKey = os.environ['Google_Translate_Key']
16
+
17
+ USER = os.getenv('API_USER')
18
+ PASSWORD = os.environ.get('API_PASSWORD')
19
 
20
  with open('pinecone_text.py' ,'w') as fb:
21
  fb.write(requests.get('https://storage.googleapis.com/gareth-pinecone-datasets/pinecone_text.py').text)
 
23
 
24
  # init connection to pinecone
25
  pinecone.init(
26
+ api_key=PineconeKey, # app.pinecone.io
27
  environment="asia-southeast1-gcp-free" # find next to api key
28
  )
29
 
 
138
  K = 5
139
 
140
  def fake_gan(text, alpha):
141
+ detected_language = single_detection(text, api_key=TranslateKey)
142
 
143
  if detected_language == 'iw':
144
  text_eng=GoogleTranslator(source='iw', target='en').translate(text)