Spaces:
Build error
Build error
Commit
·
3368fcd
1
Parent(s):
d1bd61d
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,14 @@
|
|
1 |
-
import
|
2 |
from google.oauth2 import service_account
|
3 |
from google.cloud import language_v1
|
4 |
-
import
|
5 |
-
import os
|
6 |
-
|
7 |
-
st.write(f"Debug: {type(st.secrets['google_nlp'])} - {st.secrets['google_nlp']}")
|
8 |
-
st.write(f"Debug: {type(st.secrets['google_nlp']['credentials'])} - {st.secrets['google_nlp']['credentials']}")
|
9 |
-
|
10 |
|
11 |
def sample_analyze_entities(text_content):
|
12 |
-
#
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
# If the credentials are already in dict form, no need to load from JSON
|
16 |
if not isinstance(service_account_info, dict):
|
|
|
1 |
+
import json
|
2 |
from google.oauth2 import service_account
|
3 |
from google.cloud import language_v1
|
4 |
+
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def sample_analyze_entities(text_content):
|
7 |
+
# Parse the JSON string to a dictionary
|
8 |
+
google_nlp_secrets = json.loads(st.secrets["google_nlp"])
|
9 |
+
|
10 |
+
# Now, get the credentials
|
11 |
+
service_account_info = google_nlp_secrets["credentials"]
|
12 |
|
13 |
# If the credentials are already in dict form, no need to load from JSON
|
14 |
if not isinstance(service_account_info, dict):
|