Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,16 @@
|
|
| 1 |
-
import os
|
| 2 |
import streamlit as st
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
st.write("sys.path =", sys.path)
|
| 6 |
-
st.write("/app/src exists?", os.path.exists("/app/src"))
|
| 7 |
-
st.write("/app/src/macg exists?", os.path.exists("/app/src/macg"))
|
| 8 |
-
st.write("Files in /app/src/macg:", glob.glob("/app/src/macg/*"))
|
| 9 |
|
| 10 |
try:
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
except Exception as e:
|
| 18 |
-
st.error(f"Import failed: {e}")
|
| 19 |
-
st.stop()
|
| 20 |
|
| 21 |
st.set_page_config(page_title="Multi-Agent Codegen (HF)", layout="wide")
|
| 22 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
import streamlit as st
|
| 3 |
+
from streamlit.errors import StreamlitSecretNotFoundError
|
| 4 |
|
| 5 |
+
hf_token = os.getenv("HF_TOKEN") # default from env
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
try:
|
| 8 |
+
# only works if secrets.toml exists
|
| 9 |
+
if "HF_TOKEN" in st.secrets:
|
| 10 |
+
hf_token = st.secrets["HF_TOKEN"]
|
| 11 |
+
except StreamlitSecretNotFoundError:
|
| 12 |
+
# no secrets configured; keep env value
|
| 13 |
+
pass
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
st.set_page_config(page_title="Multi-Agent Codegen (HF)", layout="wide")
|
| 16 |
|