File size: 407 Bytes
d5257f7 | 1 2 3 4 5 6 7 8 9 10 11 12 | 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"))
|