Build an F1 team-radio hackathon game as a Gradio Space with a browser-side Tiny Aya judge
Session from pit-wall-chaos-traces on Hugging Face by build-small-hackathon · CC-BY-4.0 · condensed by Coders Talk
Implement an MVP of a small F1 team-radio game (per an existing spec) as a Gradio Space, using the HF dataset directly for clips and a client-side transformers.js/ONNX Tiny Aya model to judge player replies, focusing only on the main game loop.
- +0Prompt · +0Build the Thousand Token Pit Wall game per the spec: Gradio Space, HF dataset for radio clips, Tiny Aya ONNX via transformers.js for judging replies, start/download/game screens, follow the concept art loosely, skip difficulty/testing for now.
- +0mAgent did · +0mRead the hackathon rules, dataset README, game spec, and Tiny Aya README; inspected repo contents and images; decided on architecture: Python handles dataset/audio/state, browser runs Tiny Aya via transformers.js with a deterministic fallback judge.
- +1mAgent did · +1mSince docs search returned little, inspected the installed Gradio 6.15.2 API directly (Blocks.launch, event hooks, component signatures) via a bundled Python runtime after discovering no system python was on PATH; verified image assets and available packages (pandas yes, datasets/soundfile no).
- +5mAgent did · +5mViewed the concept art and background images, designed a three-screen flow (briefing, boot/download, pit-wall console), then wrote app.py (~1284 lines) plus requirements.txt implementing the full game loop.
- +9mAgent did · +9mCompiled and imported app.py to catch Blocks wiring errors without launching a server; found and removed a duplicated output in the submit handler, then verified output counts.
- +10mFail · +10mNoticed gr.State was carrying full audio blobs on every submit, an unnecessary and costly payload since the browser judge only needs transcript/metadata.
- +10mAgent did · +10mStripped audio bytes out of gr.State and hardened the JSON extraction logic so the browser-side parser grabs the last actual judge JSON object even if the model echoes the prompt's example schema.
- +11mAgent did · +11mRan compile/import checks and a manual parser test with an echoed-prompt-shaped string to confirm the fallback JSON extraction works; added a Space README.md with Gradio metadata for the eventual Hub upload.
- +13mAgent did · +13mAdded a fast-path so overlong or empty replies bypass the model call entirely and get an instant deterministic penalty instead of waiting on Tiny Aya.
- +13mOutcome · +13mMVP delivered: app.py (~1284 lines), requirements.txt, README.md — full start/boot/game-loop flow, dataset loading via `MikCil/f1-team-radio`, Tiny Aya ONNX judge with fallback, 12-word limit enforced, not yet run by the developer.
Next time I'd have it check for a working Python runtime and gradio version up front, since that cost several minutes of failed docs searches and PATH issues before it could even inspect the API. The real save was catching that gr.State was shuttling full audio blobs through every submit and hardening the JSON parser for echoed prompts — those two fixes made the browser-side judge actually reliable. I still need to run it myself since I didn't let it launch the Space locally.