Spaces:
Sleeping
Sleeping
Commit History
-
Stream animation frames inline via gr.HTML data URIsβ
The previous attempt cut payload size but left a structural problem: gr.Image in Gradio 5 saves each yielded PIL image to a temp file and sends the client a URL β the client then fetches the image with a second HTTP request per frame. Over HF Spaces' RTT, that fetch dominates each frame's budget and the 15-frame animation collapses into the final state by the time the client finishes the queue. Switch the board widget from gr.Image to gr.HTML and inline each frame as <img src="data:image/webp;base64,..."> via _img_to_html. The bytes ride inside the SSE event itself β no second fetch β so frames render the moment the client receives them. Also revert render_board figsize/dpi to (7, 7.6) / 120 so the rendered board doesn't look degraded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>dc8f574 -
Cut Gradio per-frame payload + render costβ
Slider previews and animation frames were spending most of their budget on render and wire transfer, not on streaming logic: - render_board ran matplotlib at dpi=120 figsize=(7, 7.6), producing an ~840Γ912 PNG for a widget displayed at 560px. Drop to dpi=110 figsize=(5, 5.4) β ~550Γ594, matches the display size, ~3Γ faster. - gr.Image transmitted PNG by default (~100-200KB per frame). Set format="webp" so each frame ships an order of magnitude smaller. - Slider preview was firing on every drag step via slider.change, flooding the queue. Switch to slider.release so we only re-render once the user lets go. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>6c5e416 -
Fix Gradio animation streaming on HF Spacesβ
Frame-by-frame animation in the Gradio UI was collapsing to a single final frame on the deployed Space because: - The same Blocks instance was mounted at both "/" and "/web", which breaks SSE/queue routing β Gradio's frontend resolves queue endpoints relative to the page URL and the two mounts collide on session IDs. - No explicit queue was configured, so streaming generators had no reliable channel for incremental yields once mounted under FastAPI. - Gradio was unpinned and pulled in transitively, so HF builds could resolve to a different version than the one tested locally. Drop the duplicate /web mount, call queue() explicitly, and pin gradio>=4.44,<5 in both pyproject.toml and the Dockerfile install. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>d0a7466
-
Mount Gradio UI at root path so HF Spaces iframe shows itβ
HF Docker Spaces iframe-load the container's root path (/). Our Gradio UI was only mounted at /web, so the Space appeared blank. Keep /web for backward compat with existing docs, also mount at / for HF. Also drop the unsupported `base_path: /web` field from README frontmatter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>aa50c6c -
Initial: OpenEnv Carrom v0.3.0 β ICF-compliant physics RL environmentβ
Physics & env: - Pymunk-based 2D board with Coulomb board friction via per-body velocity_func (constant decel, not viscous damping). - Full ICF rules: due rule, queen cover, foul handling, striker baseline. - Decoupled pocket_capture_radius=0.09 from pocket_radius=0.06 so pieces in the wall-gap "dead zone" are caught correctly. Green agent (evaluator): - GreenCarromAgent implements the AgentBeats evaluator role: defines task suites (easy/standard/hard tiers), wraps the env, scores purple agents with ICF-aware metrics (reward, win rate, ICF compliance) + compute efficiency. Inference: - inference.py with multi-provider OpenAI-compatible API support (Nebius / OpenAI / HF / local vLLM via API_BASE_URL + key env var). - --web flag starts the server + Gradio UI for watching LLM play live. - Reasoning-model fallback to reasoning_content when content is null. Gradio UI: - "Auto-play with LLM" panel: endpoint/model/key/turns inputs, streams physics animations between each LLM β¦13b4881