File size: 1,511 Bytes
c8a6c00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: Spelling Practice
emoji: πŸ“
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: "4.40.0"
app_file: app.py
pinned: false
license: mit
---

# Spelling Practice πŸ“

An interactive English spelling trainer powered by gTTS (audio) and optionally Gemma (AI tips).

## How to use

1. Click **New Sentence** β€” a sentence is read aloud.
2. Type exactly what you heard in the text box.
3. Click **Submit** (or press Enter).
4. Errors are shown with strikethrough (~~wrong~~) and the **correct** word in bold.
5. Get 3 correct answers in a row to level up.

## Difficulty levels

| Level | Label |
|-------|-------|
| 1 | 🟒 Beginner |
| 2 | πŸ”΅ Intermediate |
| 3 | 🟠 Advanced |
| 4 | πŸ”΄ Expert |

## Multi-user support

Every browser session gets its own isolated state via `gr.State`.  
Concurrent users don't share or interfere with each other.

## Optional: AI Tips with Gemma

To enable in-app spelling tips from a local LLM:

1. Upload a `.gguf` model file to your Space repository (e.g. `gemma-4-E2B-it-Q4_0.gguf`).
2. Uncomment `llama-cpp-python` in `requirements.txt`.
3. If your Space has a GPU, replace the pip line with the CUDA wheel:
   ```
   llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
   ```
4. Set the `N_GPU_LAYERS` Space secret to `-1` (full GPU offload) or `0` (CPU only).

Without a model file the app runs fine β€” the tip section is simply hidden.

## Local development

```bash
pip install gradio gTTS
python app.py
```