File size: 1,718 Bytes
2441d52
4eab58f
 
 
2441d52
 
 
 
4eab58f
2441d52
 
4eab58f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Reading & Pronunciation Coach
emoji: 🗣️
colorFrom: indigo
colorTo: green
sdk: gradio
app_file: app.py
pinned: false
short_description: Hindi & English reading practice with pronunciation scoring
---

# Reading & Pronunciation Coach

Read a passage aloud in Hindi or English and get a word-level error breakdown:
WER, CER, strict and lenient accuracy, speaking rate, and pause count.

## Configuration

Set these under **Settings → Variables and secrets**.

| Name | Type | Value |
|---|---|---|
| `ASR_BACKEND` | Variable | `groq` \| `zerogpu` \| `local` \| `auto` |
| `GROQ_API_KEY` | **Secret** | required for the `groq` backend |
| `GROQ_MODEL_HI` | Variable | default `whisper-large-v3` |
| `GROQ_MODEL_EN` | Variable | default `whisper-large-v3-turbo` |
| `LOCAL_TIER` | Variable | `fast` \| `balanced` \| `accurate` (local only) |

## Choosing a backend

**`groq` on free CPU hardware** — recommended. Only transcription needs a GPU,
and Groq rents it per second of audio. Uncomment nothing in `requirements.txt`.
Trade-off: no per-word confidence, so the "Unclear words" metric is hidden.

**`zerogpu`** — free GPU, `transformers` path. Uncomment the ZeroGPU block in
`requirements.txt` and select ZeroGPU hardware. Note that `faster-whisper` will
*not* work here: CTranslate2 does not allocate through PyTorch's CUDA allocator,
so it cannot see a ZeroGPU-assigned device.

**`local`** — your machine or paid GPU Spaces hardware. The only backend that
reports per-word ASR confidence, which is a useful mumbling signal. Uncomment
the `faster-whisper` line.

## Local development

```bash
pip install -r requirements.txt faster-whisper
ASR_BACKEND=local LOCAL_TIER=fast python app.py
```