dvpearl commited on
Commit
26d515e
·
verified ·
1 Parent(s): 44545fd

Update app.py

Browse files

Added changes to read gss_credentials from the Hugging Face secrets environment

Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -41,8 +41,15 @@ def gs_client_from_secrets():
41
  if not GS_AVAILABLE:
42
  return None
43
 
44
- creds_str = st.secrets.get("gss_credentials", None)
 
 
 
 
 
 
45
  if not creds_str:
 
46
  return None
47
 
48
  try:
 
41
  if not GS_AVAILABLE:
42
  return None
43
 
44
+ # Try reading from Hugging Face environment variable first
45
+ creds_str = os.environ.get("gss_credentials", "")
46
+
47
+ if not creds_str:
48
+ # Fallback to Streamlit Cloud secrets
49
+ creds_str = st.secrets.get("gss_credentials", "").strip()
50
+
51
  if not creds_str:
52
+ logging.error("No Google Sheets credentials found.")
53
  return None
54
 
55
  try: