""" 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)