File size: 2,691 Bytes
bf774ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Deployment Guide β€” HuggingFace Space

## Quick Deploy (3 steps)

### Step 1: Create a new HuggingFace Space

1. Go to [huggingface.co/new-space](https://huggingface.co/new-space)
2. Fill in:
   - **Owner**: `PlotweaverAI` (or your account)
   - **Space name**: `live-football-commentary-en-yo`
   - **SDK**: Gradio
   - **Hardware**: **T4 small** (GPU required β€” free tier CPU won't work well)
   - **Visibility**: Public
3. Click **Create Space**

### Step 2: Upload the files

Upload these 3 files to the Space repo (via the web UI or git):

```
β”œβ”€β”€ README.md           ← Space metadata (hardware, tags, etc.)
β”œβ”€β”€ app.py              ← Main Gradio application
└── requirements.txt    ← Python dependencies
```

**Option A β€” Web upload:**
- Go to your Space β†’ Files β†’ "Add file" β†’ Upload each file

**Option B β€” Git (recommended):**
```bash
# Clone the space
git clone https://huggingface.co/spaces/PlotweaverAI/live-football-commentary-en-yo
cd live-football-commentary-en-yo

# Copy the files
cp /path/to/hf_space/* .

# Push
git add .
git commit -m "Initial deploy: EN→YO commentary pipeline"
git push
```

### Step 3: Wait for build

The Space will automatically:
1. Install dependencies from `requirements.txt`
2. Download all 3 models from HuggingFace Hub
3. Start the Gradio app

First build takes ~5-10 minutes (model downloads). Subsequent restarts are faster due to caching.

---

## Hardware Notes

| Hardware | Cost | Performance |
|----------|------|-------------|
| T4 small | ~$0.60/hr | Good β€” full pipeline in ~6-10s |
| T4 medium | ~$1.00/hr | Better for concurrent users |
| A10G small | ~$1.05/hr | Fastest inference |
| CPU basic | Free | Very slow (~60s+), not recommended |

The Space will **sleep after 48 hours of inactivity** on paid hardware.
You can enable "persistent" mode in Space settings to keep it running.

---

## Troubleshooting

**Space keeps crashing / OOM:**
- T4 small has 16GB VRAM β€” should be enough for all 3 models in float16
- If issues persist, try T4 medium

**Models fail to load:**
- Make sure all 3 model repos are **public** on HuggingFace
- If private, add a `HF_TOKEN` secret in Space settings

**Audio recording doesn't work:**
- Browser mic access requires HTTPS (HuggingFace Spaces provides this)
- Make sure you've granted microphone permission in the browser

---

## Customization

**To add more source/target languages** (your MT model supports 6):
Edit `app.py` and add a language dropdown to the Gradio UI.
Your NLLB model likely supports these codes:
- `eng_Latn` (English)
- `yor_Latn` (Yoruba)
- `ibo_Latn` (Igbo)
- `hau_Latn` (Hausa)
- Check your model card for the full list.