Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 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 |
-
|
| 88 |
-
|
| 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 =
|
| 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).")
|