Skip to content

Commit 7a6201d

Browse files
committed
Improve Space detection and ensure Model Not Found never shows in Space
1 parent c4bd0c4 commit 7a6201d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
def _is_running_in_hf_space() -> bool:
2222
"""Check if app is running in Hugging Face Space."""
23-
# HF Spaces set SPACE_ID environment variable
24-
return os.getenv("SPACE_ID") is not None
23+
# HF Spaces set SPACE_ID or SYSTEM environment variable
24+
return os.getenv("SPACE_ID") is not None or os.getenv("SYSTEM") == "spaces"
2525

2626

2727
def _get_default_source() -> str:

0 commit comments

Comments
 (0)