| import os | |
| def is_hosted_space() -> bool: | |
| """Return whether the app runs on a hosted Hugging Face Space. | |
| User-facing remediation depends on the runtime: a local user can run the | |
| ingestion command, while a hosted-app user must ask the maintainer to | |
| update and redeploy the committed data snapshot. | |
| """ | |
| return os.environ.get("SYSTEM") == "spaces" or bool(os.environ.get("SPACE_ID")) | |