--- title: Homework Hero emoji: 🦸 colorFrom: indigo colorTo: yellow sdk: gradio sdk_version: 6.30.0 app_file: app.py pinned: false license: apache-2.0 short_description: One homework question at a time, for kids with ADHD --- # Homework Hero Hold a worksheet up to the camera and Homework Hero turns it into a game with one question at a time. Built for kids with ADHD, who often freeze when they see a full page of problems. Gemma 4 reads the worksheet, checks answers, and gives hints that never reveal the answer. Pip, a friendly space buddy, cheers kids on while a rocket flies toward the finish. Sounds, confetti, stars and streaks reward progress; a "read it to me" button speaks each question; "later" saves hard questions for the end; and a movement break every 3 questions keeps kids moving. Sound can be turned off, and animations stop automatically for anyone whose device is set to reduce motion. Hints and cheers can be in English, Spanish, Amharic, or French. No accounts, and no photos are saved. ## How it connects to Gemma 4 The app tries these in order and moves to the next one if a step fails: 1. **Hugging Face Inference Providers** (`google/gemma-4-31B-it`), when the `HF_TOKEN` secret is set. Free accounts get a small monthly credit; when it runs out, the app moves on. 2. **Ollama** on your own computer (`gemma4:e4b`), when it's running. 3. **Demo mode** with `sample_worksheet.png`, so the screens always work. ## Deploy on Hugging Face Spaces 1. Create a new Space with the Gradio SDK and upload these files. 2. Create a token at huggingface.co/settings/tokens with "Make calls to Inference Providers" turned on. 3. In the Space, open Settings, then Variables and secrets, and add a secret named `HF_TOKEN` with that token. ## Run on your laptop ``` pip install -r requirements.txt ollama pull gemma4:e4b # optional, for offline use python app.py ``` Open http://127.0.0.1:7860. To use the Hugging Face API locally, run `HF_TOKEN=your_token python app.py`. ## Settings | Variable | Default | What it does | |---|---|---| | `HF_TOKEN` | not set | Turns on the Hugging Face API | | `HF_MODEL` | `google/gemma-4-31B-it` | Which Gemma 4 model to call on Hugging Face | | `HERO_MODEL` | `gemma4:e4b` | Which Ollama model to use | | `OLLAMA_URL` | `http://localhost:11434` | Where Ollama is running | | `HERO_DEMO` | `0` | Set to `1` to skip Gemma and use the sample worksheet | ## Next steps - Voice answers using Gemma 4's audio input - Read each question aloud - A parent view with the session summary Homework Hero supports focus and routines. It is not a medical tool or treatment for ADHD. ## License Apache 2.0