NexusInstruments commited on
Commit
63ff4f2
·
verified ·
1 Parent(s): ce0124c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -17
app.py CHANGED
@@ -1,6 +1,6 @@
1
  from dotenv import load_dotenv
2
  import streamlit as st
3
- import sys, os, requests, pathlib
4
 
5
  # ─── Load Configuration from .env ───────────────────────────────
6
  def load_config():
@@ -72,24 +72,12 @@ with st.expander("🧩 Session Diagnostics", expanded=False):
72
  # ─── Embed Taipy Realtime Dashboard ─────────────────────────────
73
  st.subheader("📊 Realtime System Dashboard (Taipy)")
74
 
75
- # Safe Hugging Face check
76
- import contextlib
77
-
78
- st.subheader("📊 Realtime System Dashboard (Taipy)")
79
-
80
- # Safe Hugging Face / local check
81
- import contextlib
82
-
83
- st.subheader("📊 Realtime System Dashboard (Taipy)")
84
-
85
- # Safe Hugging Face / local check
86
  with contextlib.suppress(Exception):
87
- has_secrets = bool(getattr(st, "secrets", None))
88
- space_id = None
89
- if has_secrets:
90
- # st.secrets might raise if no file is present, so use suppress again
91
  with contextlib.suppress(Exception):
92
- space_id = st.secrets.get("SPACE_ID")
93
 
94
  if space_id:
95
  st.info("Taipy dashboard is disabled on Hugging Face Spaces (requires local port).")
 
1
  from dotenv import load_dotenv
2
  import streamlit as st
3
+ import sys, os, requests, pathlib, contextlib
4
 
5
  # ─── Load Configuration from .env ───────────────────────────────
6
  def load_config():
 
72
  # ─── Embed Taipy Realtime Dashboard ─────────────────────────────
73
  st.subheader("📊 Realtime System Dashboard (Taipy)")
74
 
75
+ space_id = None
 
 
 
 
 
 
 
 
 
 
76
  with contextlib.suppress(Exception):
77
+ secrets_obj = getattr(st, "secrets", None)
78
+ if secrets_obj:
 
 
79
  with contextlib.suppress(Exception):
80
+ space_id = secrets_obj.get("SPACE_ID", None)
81
 
82
  if space_id:
83
  st.info("Taipy dashboard is disabled on Hugging Face Spaces (requires local port).")