---
title: Darija Transcription & Diarization API
emoji: 🚀
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
suggested_hardware: t4-small
license: apache-2.0
---
# Darija Transcription & Diarization API
A FastAPI-based service for transcribing and diarizing Moroccan Darija audio using OpenAI Whisper with LoRA fine-tuning and pyannote speaker diarization.
## Features
✨ **Speech-to-Text**: Transcribes Darija audio using Whisper + LoRA fine-tuned model
👥 **Speaker Diarization**: Identifies and labels different speakers
📤 **Multiple Export Formats**: JSON, VTT, SRT, TXT
🚀 **GPU-Accelerated**: Optimized for CUDA devices
🔄 **Retry Logic**: Automatic retries for robust downloads
## Deploy to Hugging Face Spaces 🤗
### Step 1: Prepare Your GitHub Repository
1. Create a new GitHub repository (or use an existing one)
2. Clone it locally:
```bash
git clone
github.com
cd darija-transcription
```
3. Add these files to your repo:
- `app.py` âś“
- `requirements.txt` âś“
- `Dockerfile` âś“
- `.gitignore` âś“
- `README.md` (this file)
4. Commit and push:
```bash
git add .
git commit -m "Initial commit: Darija transcription API"
git push origin main
```
### Step 2: Create a Hugging Face Space
1. Go to
huggingface.co
2. Click **"Create new Space"**
3. Fill in:
- **Space name**: `darija-transcription` (or your preferred name)
- **License**: Apache 2.0 (or your choice)
- **Space SDK**: Docker
- **Space hardware**: **GPU T4** (free tier: ~20 hrs/week)
- **Private or Public**: Choose your preference
4. Click **"Create Space"**
### Step 3: Connect Your Repository
1. In your newly created Space, click **"Settings"** (⚙️ icon)
2. Under **"Linked Repository"**, paste your GitHub repo URL:
```
github.com
```
3. Click **"Link repository"**
The Space will automatically build and deploy from your GitHub repo!
### Step 4: Add Environment Variables (Important!)
1. Go to **S …