Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,12 +30,9 @@ except Exception:
|
|
| 30 |
hf_hub_download = None
|
| 31 |
HfHubHTTPError = Exception
|
| 32 |
|
| 33 |
-
HF_TOKEN = (
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
or os.getenv("key") # backwards compat
|
| 37 |
-
)
|
| 38 |
-
PRIVATE_REPO = (os.getenv("PRIVATE_REPO") or "").strip() or "fallback"
|
| 39 |
huggingface_model_path = None
|
| 40 |
|
| 41 |
def _try_hf_download(repo_id: str, filename: str, token: Optional[str]):
|
|
@@ -211,7 +208,7 @@ def preload_models():
|
|
| 211 |
if _preloaded and image_processor is not None and model is not None:
|
| 212 |
return True
|
| 213 |
try:
|
| 214 |
-
hf_repo =
|
| 215 |
if not hf_repo:
|
| 216 |
print("⚠️ MODEL_REPO not set → demo mode unless already loaded.")
|
| 217 |
return False
|
|
|
|
| 30 |
hf_hub_download = None
|
| 31 |
HfHubHTTPError = Exception
|
| 32 |
|
| 33 |
+
HF_TOKEN = os.getenv("key") # backwards compat
|
| 34 |
+
|
| 35 |
+
PRIVATE_REPO = os.getenv("PRIVATE_REPO")
|
|
|
|
|
|
|
|
|
|
| 36 |
huggingface_model_path = None
|
| 37 |
|
| 38 |
def _try_hf_download(repo_id: str, filename: str, token: Optional[str]):
|
|
|
|
| 208 |
if _preloaded and image_processor is not None and model is not None:
|
| 209 |
return True
|
| 210 |
try:
|
| 211 |
+
hf_repo = os.getenv('MODEL_REPO')
|
| 212 |
if not hf_repo:
|
| 213 |
print("⚠️ MODEL_REPO not set → demo mode unless already loaded.")
|
| 214 |
return False
|