Serve game routes through launch app_kwargs while preserving the Gradio API and disabling SSR. Add HTTP regression coverage for the startup hook, game assets, narration stream, and image response.
Mount Gradio at the root so ZeroGPU can find the @spaces.GPU functions
Claude+1: Claude Sonnet 5.5
Unverified signature
5481594
Starting worked (uvicorn on 7860) but the Space was stopped right after, and the
earlier error was 'No @spaces.GPU function detected during startup'. Gradio was
mounted under /gradio, where HF's ZeroGPU detection (best guess) does not look.
Now the game's files are plain routes registered first, and Gradio is mounted at /
so /config and /gradio_api are at the root; the page calls gradio_api/call/....
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eg7PDh5Nquz9zWpYMKwZBv
Fix start on Hugging Face: turn off Gradio SSR so its Node server doesn't take port 7860
Claude+1: Claude Opus 5.5
Unverified signature
bffb18c
HF sets GRADIO_SSR_MODE=true; mount_gradio_app then starts Gradio's Node server on
GRADIO_SERVER_PORT (7860) and uvicorn failed with 'address already in use'. Also
read the port from GRADIO_SERVER_PORT.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eg7PDh5Nquz9zWpYMKwZBv
Life² as a Hugging Face Space: game page + Gradio narrate/paint endpoints
Claude+1: Claude Opus 5.5
Unverified signature
510a1f1
FastAPI serves the Life2 page at /, /space-config, and a Gradio API at /gradio with
narrate (streamed, prompt built server-side from the fact sheet) and paint (prompt
must use only the game's own vocabulary). ZeroGPU: Qwen2.5-7B + SDXL-Turbo with the
fp16-safe VAE; CPU: Qwen2.5-1.5B + SD-Turbo. LIFE2_MOCK=1 for testing without models.
Workflow mirrors pushes to the Space once HF_TOKEN and HF_SPACE are set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eg7PDh5Nquz9zWpYMKwZBv