blazingbunny commited on
Commit
3ab7fbb
·
1 Parent(s): 6eded01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -3,10 +3,12 @@ from google.cloud import language_v1
3
  import json
4
  from google.oauth2 import service_account
5
  import os
 
 
6
 
7
  def sample_analyze_entities(text_content):
8
- # Read the JSON credentials from the secret
9
- service_account_info = json.loads(os.environ.get("GOOGLE_APPLICATION_CREDENTIALS_JSON"))
10
 
11
  # Create credentials
12
  credentials = service_account.Credentials.from_service_account_info(
 
3
  import json
4
  from google.oauth2 import service_account
5
  import os
6
+ from google.oauth2 import service_account
7
+ from google.cloud import language_v1
8
 
9
  def sample_analyze_entities(text_content):
10
+ # Read the JSON credentials from st.secrets
11
+ service_account_info = json.loads(st.secrets["google_nlp"]["credentials"])
12
 
13
  # Create credentials
14
  credentials = service_account.Credentials.from_service_account_info(