Spaces:
Build error
Build error
File size: 796 Bytes
bf55076 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | """
Gradio entrypoint for Hugging Face Spaces.
This wraps the existing demo in apps/canada_radar_gradio.py so Spaces can
discover `app.py` at the repo root.
"""
from __future__ import annotations
import os
from apps.canada_radar_gradio import demo as _demo
# Expose as `demo` for Spaces discovery
demo = _demo
if __name__ == "__main__":
# Allow local run: `python app.py`
launch_kwargs = dict(server_name="0.0.0.0", debug=True)
port = os.getenv("GRADIO_SERVER_PORT")
if port:
try:
p = int(port)
if p > 0:
launch_kwargs["server_port"] = p
except Exception:
pass
share = os.getenv("GRADIO_SHARE", "0").lower() in {"1", "true", "yes"}
launch_kwargs["share"] = share
demo.launch(**launch_kwargs)
|