Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -144,7 +144,14 @@ def infer_features_from_model(m):
|
|
| 144 |
# =========================
|
| 145 |
# Model availability (download on cloud if needed)
|
| 146 |
# =========================
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
def ensure_model_present() -> Path:
|
| 150 |
# Check local paths first
|
|
|
|
| 144 |
# =========================
|
| 145 |
# Model availability (download on cloud if needed)
|
| 146 |
# =========================
|
| 147 |
+
def _get_model_url():
|
| 148 |
+
# Works even if there is NO secrets.toml in the Space
|
| 149 |
+
try:
|
| 150 |
+
return (st.secrets.get("MODEL_URL", "") or os.environ.get("MODEL_URL", "") or "").strip()
|
| 151 |
+
except Exception:
|
| 152 |
+
return (os.environ.get("MODEL_URL", "") or "").strip()
|
| 153 |
+
|
| 154 |
+
MODEL_URL = _get_model_url()
|
| 155 |
|
| 156 |
def ensure_model_present() -> Path:
|
| 157 |
# Check local paths first
|