Spaces:
Sleeping
Sleeping
File size: 7,065 Bytes
4051511 | 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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | # π€ START HERE - Whisper Transcriber Project
## π Welcome!
You now have a **complete, production-ready SRT generator** using OpenAI Whisper!
---
## π― What You Have
A fully-functional transcription system that can:
β
Upload audio/video files
β
Download from YouTube
β
Auto-detect 99+ languages
β
Generate SRT, VTT, TXT, JSON
β
Identify speakers (optional)
β
Handle large files automatically
β
Show real-time progress
β
Provide public API
---
## π Project Files
```
hf/
βββ π app.py # Main Gradio app (RUN THIS!)
βββ π¦ requirements.txt # Dependencies
βββ π« .gitignore # Git ignore rules
β
βββ π οΈ utils/ # Core modules (1,391 lines)
β βββ audio_processor.py # Audio extraction & chunking
β βββ downloader.py # YouTube & URL downloads
β βββ transcription.py # Whisper transcription
β βββ formatters.py # SRT/VTT/TXT/JSON output
β βββ diarization.py # Speaker identification
β
βββ π Documentation/
βββ β‘ QUICK_START.md # READ THIS FIRST!
βββ π§ͺ LOCAL_TESTING.md # Test locally
βββ π DEPLOYMENT.md # Deploy to HF Spaces
βββ π PROJECT_SUMMARY.md # Technical details
βββ π README.md # Full documentation
```
---
## π Quick Start (Choose One)
### Option A: Deploy to Hugging Face (5 minutes)
**Easiest option - No local setup needed!**
1. Go to [huggingface.co/spaces](https://huggingface.co/spaces)
2. Create new Space (Gradio SDK)
3. Upload all files from this folder
4. Wait 5-10 minutes for build
5. Done! Your app is live π
**π See `QUICK_START.md` for detailed steps**
---
### Option B: Run Locally (10 minutes)
**Full control - Run on your computer**
```bash
# 1. Install FFmpeg
choco install ffmpeg # Windows
brew install ffmpeg # Mac
apt install ffmpeg # Linux
# 2. Setup Python
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
# 3. Run!
python app.py
```
Then open: http://127.0.0.1:7860
**π See `LOCAL_TESTING.md` for detailed steps**
---
## π Documentation Guide
**New to the project?**
1. Start with `QUICK_START.md` (5-min read)
2. Then `README.md` for full features
**Want to test locally?**
β `LOCAL_TESTING.md`
**Ready to deploy?**
β `DEPLOYMENT.md`
**Need technical details?**
β `PROJECT_SUMMARY.md`
---
## π― First Steps After Setup
### Test with a Sample
1. **Find a short audio file** (1-2 minutes)
- Or use a YouTube URL
2. **Run the app**
- Upload the file
- Select "Small" model
- Click "Generate Transcription"
3. **Download results**
- Try the SRT file first
- Open in a text editor
**Example YouTube URL to test:**
```
https://www.youtube.com/watch?v=dQw4w9WgXcQ
```
---
## βοΈ Basic Settings
### Model Selection
- **Tiny**: Fastest (use for testing)
- **Small**: Recommended (good balance)
- **Medium**: Best quality (slower)
### Language
- **Auto-detect**: Works great! (recommended)
- **Manual**: Select if you know the language
### Speaker Diarization
- **Off**: Faster (default)
- **On**: Identifies different speakers (requires HF token)
---
## π What to Expect
### Processing Time (10-minute audio)
| Setup | Model | Time |
|-------|-------|------|
| CPU | Tiny | ~1 min |
| CPU | Small | ~3-5 min |
| CPU | Medium | ~8-10 min |
| GPU | Small | ~1 min |
### Output Files
After processing, you get **4 files**:
1. **π filename.srt** - Most common, for video players
2. **π filename.vtt** - For web players
3. **π filename.txt** - Plain text transcript
4. **π filename.json** - Full data with word timestamps
---
## π API Usage (Advanced)
Yes, this has an API! Use it in your code:
```python
from gradio_client import Client
client = Client("YOUR_SPACE_URL")
result = client.predict(
url_input="https://youtube.com/watch?v=...",
model_size="small",
language="auto",
enable_diarization=False
)
```
---
## π‘ Pro Tips
### For Best Results
- Use high-quality audio (clear speech)
- Choose specific language if known
- Use Medium model for final production
### For Speed
- Use Tiny model for quick tests
- Keep files under 10 minutes
- Disable speaker diarization
### For YouTube
- Some videos may be restricted
- Use direct file upload as fallback
- Works with unlisted videos
---
## π Common Issues
### "ModuleNotFoundError"
β Run: `pip install -r requirements.txt`
### "FFmpeg not found"
β Install FFmpeg (see QUICK_START.md)
### "YouTube download failed"
β Video may be restricted, try file upload
### "Slow processing"
β Normal on CPU, use smaller model or GPU
### "Speaker diarization not working"
β Need HF_TOKEN (see DEPLOYMENT.md)
---
## π¨ Features Included
### Input Methods
β
File upload (drag & drop)
β
YouTube URLs
β
Direct media URLs
β
Multiple formats (MP3, MP4, WAV, etc.)
### Processing
β
Auto audio extraction from video
β
Large file chunking (>30 min)
β
Multi-language support (99+)
β
Word-level timestamps
β
Speaker identification (optional)
### Output
β
SRT subtitles
β
VTT web format
β
Plain text
β
JSON with metadata
β
Preview in browser
### UI/UX
β
Real-time progress bars
β
Clear error messages
β
Download buttons for all formats
β
Model selection
β
Language selection
β
Clean, modern interface
### Technical
β
Public API endpoint
β
Automatic cleanup
β
GPU support (auto-detected)
β
Error handling
β
Memory efficient
---
## π Next Steps
1. **Choose your deployment option** (HF Spaces or Local)
2. **Read the relevant guide** (QUICK_START.md or LOCAL_TESTING.md)
3. **Test with a sample file**
4. **Share your app!** (if deployed to HF Spaces)
---
## π Need Help?
**Documentation:**
- QUICK_START.md - Basic setup
- LOCAL_TESTING.md - Local development
- DEPLOYMENT.md - HF Spaces deployment
- README.md - Full documentation
**Support:**
- Check the documentation first
- Review error messages
- Open an issue on GitHub
---
## β
Project Checklist
### Before Deploying
- [ ] Read QUICK_START.md
- [ ] Choose deployment method
- [ ] Test locally (optional but recommended)
- [ ] Prepare sample files for testing
### After Deploying
- [ ] Test basic transcription
- [ ] Try YouTube download
- [ ] Test different models
- [ ] Share with users!
---
## π You're All Set!
Your Whisper Transcriber is **ready to go**!
**Next step:** Open `QUICK_START.md` and choose your deployment method.
**Questions?** Check the documentation files above.
**Ready to transcribe?** Let's go! π€
---
**Built with:**
- OpenAI Whisper (speech recognition)
- Gradio (web interface)
- PyTorch (deep learning)
- Pyannote.audio (speaker diarization)
- FFmpeg (audio/video processing)
- yt-dlp (YouTube downloads)
**License:** MIT (free for personal and commercial use)
---
Happy transcribing! π
|