Build an F1 team-radio Gradio game with in-browser Tiny Aya judging
Session from pit-wall-chaos-traces on Hugging Face by build-small-hackathon · CC-BY-4.0 · condensed by Coders Talk
Implement a hackathon Gradio Space game where players reply to real F1 team radio clips and get judged by an in-browser Tiny Aya ONNX model, following a provided game spec and dataset.
- +0Prompt · +0Build the Thousand Token Pit Wall game as a Gradio Space: start screen, dataset+model download, then main game loop using the F1 team radio dataset and Tiny Aya ONNX via transformers.js, inspired by an example gradio_example app.
- +0mAgent did · +0mRead specs, dataset README, Tiny Aya README and the example app, viewed the concept art, then built app.py (FastAPI/Gradio Server backend), index.html, static/app.js and styles.css implementing start/loading/game/end screens with a clip deck loader and browser-side model judging.
- +22mPrompt · +22mInference always returns the fallback 'Understandable, but it needs more race-engineer bite' placeholder regardless of input; compare against the now-working Tiny Aya example config and fix.
- +22mAgent did · +22mCompared judge code to the working example, rewrote static/app.js to match its tokenizer/model class, dtype, chat template and TextStreamer usage, and reset the model promise on load failure so retries aren't permanently broken.
- +34mFail · +34mDeveloper reported the placeholder message still appeared after the inference plumbing fix.
- +35mAgent did · +35mTraced the fallback path and found findJsonObject() was returning the nested 'delta' JSON object instead of the full judge response; rewrote the extractor to prefer JSON candidates shaped like the judge schema, fixing the real parsing bug.
- +46mPrompt · +46mClips only come from 2018, and the game jumps straight to the end screen after the final verdict instead of waiting for the usual next-message button press.
- +46mAgent did · +46mChanged the clip deck loader from 'first 260 valid clips' to reservoir sampling across a larger scanned window to fix the 2018 skew, and changed the final round so the verdict screen stays until the next-button (now 'Final Result') is pressed.
- +1h 1mIntervention · +1h 1mReservoir sampling made load times too long, then a streaming shuffle fix still returned all-2023 or all-2024 clips repeatedly across many restarts; developer asked to abandon remote sampling tricks and try a local manifest of clip IDs instead.Why: The dataset stream seemed grouped by season/shard no matter how I shuffled or sampled offsets, so I kept getting single-year decks; since this will run in a Space anyway, a local manifest felt like the only way to guarantee both speed and real variety.
- +1h 16mOutcome · +1h 16mSession ended mid-build: added a manifest-first loader and a build_manifest.py script, fixed an audio-field parsing bug (list vs dict) found via debugging, but the manifest generation run against the Dataset Viewer API was interrupted by the user after ~5 minutes before a complete season-balanced manifest file was produced.
Next time I'd ask upfront how the HF dataset is sharded/ordered so we don't burn a whole session discovering that streaming shuffle only randomizes within a season-grouped window. The fix that actually mattered for inference was tracing the JSON extractor bug (it was grabbing the nested 'delta' object instead of the full judge response) rather than any of my resemblance-based config tweaks. By the end we had a working game and judging pipeline, but the season-bias problem was still unresolved when I had to cut the manifest-build run short.