Spaces:
Running on Zero
Running on Zero
| """Probe: confirm sdk: gradio Spaces autoboot a gradio.Server app. | |
| Push this as the only Python file in a throwaway Space copy with | |
| sdk: gradio and verify both routes return 200. If they do, the design's | |
| sdk: gradio assumption holds and we proceed. If they don't, halt and | |
| execute fallback 2a (plain FastAPI host) per the spec. | |
| """ | |
| import gradio | |
| from fastapi.responses import HTMLResponse | |
| app = gradio.Server() | |
| async def index(): | |
| return "<!doctype html><html><body><h1>probe ok</h1></body></html>" | |
| def ping() -> dict: | |
| return {"ok": True} | |
| if __name__ == "__main__": | |
| app.launch(server_name="0.0.0.0", server_port=7860) | |