Skip to content
CodexgreenfieldWeb3 files · +1373 −13

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

13msession
0interventions
GOAL

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.

  1. Prompt · +0
    Build 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.
  2. Agent did · +0m
    Read 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.
  3. Agent did · +1m
    Since 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).
  4. Agent did · +5m
    Viewed 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.
  5. Agent did · +9m
    Compiled 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.
  6. Fail · +10m
    Noticed gr.State was carrying full audio blobs on every submit, an unnecessary and costly payload since the browser judge only needs transcript/metadata.
  7. Agent did · +10m
    Stripped 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.
  8. Agent did · +11m
    Ran 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.
  9. Agent did · +13m
    Added 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.
  10. Outcome · +13m
    MVP 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.
VERDICT

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.

I tried this · 0

Discussion · 0

How Builds work