Spaces:
Build error
Build error
Commit
·
3ab7fbb
1
Parent(s):
6eded01
Update app.py
Browse files
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
|
9 |
-
service_account_info = json.loads(
|
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(
|