Upload folder using huggingface_hub
Browse files- src/app.py +12 -4
src/app.py
CHANGED
|
@@ -195,13 +195,21 @@ def main() -> None:
|
|
| 195 |
|
| 196 |
st.header("π Quick Stats")
|
| 197 |
if is_in_space:
|
|
|
|
| 198 |
if config.HF_TOKEN and config.HF_MODEL_REPO:
|
| 199 |
-
st.success("β
Model
|
| 200 |
-
st.caption("
|
| 201 |
else:
|
| 202 |
-
st.error("β
|
| 203 |
-
st.caption("Set HF_TOKEN as Space secret")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
else:
|
|
|
|
| 205 |
if os.path.exists(config.BEST_MODEL_LOCAL_PATH):
|
| 206 |
st.success("β
Model Available")
|
| 207 |
st.caption("Trained model found locally")
|
|
|
|
| 195 |
|
| 196 |
st.header("π Quick Stats")
|
| 197 |
if is_in_space:
|
| 198 |
+
# In Space: always show HF model status
|
| 199 |
if config.HF_TOKEN and config.HF_MODEL_REPO:
|
| 200 |
+
st.success("β
Model Ready")
|
| 201 |
+
st.caption(f"Loading from: {config.HF_MODEL_REPO}")
|
| 202 |
else:
|
| 203 |
+
st.error("β Configuration Missing")
|
| 204 |
+
st.caption("Set HF_TOKEN as Space secret in Settings")
|
| 205 |
+
st.markdown("""
|
| 206 |
+
**To fix:**
|
| 207 |
+
1. Go to Space Settings
|
| 208 |
+
2. Add secret: `HF_TOKEN`
|
| 209 |
+
3. Restart Space
|
| 210 |
+
""")
|
| 211 |
else:
|
| 212 |
+
# Local development: check local model
|
| 213 |
if os.path.exists(config.BEST_MODEL_LOCAL_PATH):
|
| 214 |
st.success("β
Model Available")
|
| 215 |
st.caption("Trained model found locally")
|