Spaces:
Running
Running
File size: 2,830 Bytes
38024bc |
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 |
# Development
## Design Decisions
We specifically opt for a single-space leaderboard for simplicity. We solve the issue of keeping the gradio UI interactive while models are evaluating by using background tasks instead of a separate space.
## Setup
### Prerequisites
* Python 3.10
* Git
* A love for speech recognition! π€
### Quick Installation
1. Clone this repository:
```bash
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/spaces/KoelLabs/IPA-Transcription-EN
cd IPA-Transcription-EN
```
2. Set up your environment and download data:
```bash
. ./scripts/install.sh
```
3. Launch the leaderboard in development mode (auto-reloads on code changes):
```bash
. ./scripts/run-dev.sh
```
4. Visit `http://localhost:7860` in your browser and see the magic! β¨
## Adding/Removing Dependencies
0. Activate the virtual environment with `. ./venv/bin/activate`
1. Add the dependency to `requirements.txt` (or remove it)
2. Make sure you have no unused dependencies with `pipx run deptry .`
3. Run `pip install -r requirements.txt`
4. Freeze the dependencies with `pip freeze > requirements_lock.txt`
## Run without reloading
```bash
. ./scripts/run-prod.sh
```
## File Structure
The two most imporant files are `app/app.py` for the main gradio UI and `app/tasks.py` for the background tasks that evaluate models.
```
IPA-Transcription-EN/
βββ README.md # General information about the leaderboard
βββ CONTRIBUTING.md # Contribution guidelines
βββ DEVELOPMENT.md # Development setup and design decisions
βββ requirements.txt # Python dependencies
βββ requirements_lock.txt # Locked dependencies
βββ scripts # Helper scripts
β βββ install.sh # Install dependencies and download data
β βββ run-dev.sh # Run the leaderboard in development mode
βββ venv # Virtual environment
βββ app/ # All application code lives here
β βββ data/ # Phoneme transcription datasets
β βββ queue/ # Stores leaderboard state and task status
β | βββ tasks.json # Task queue
β | βββ results.json # Detailed evaluation results
β | βββ leaderboard.json # Compact results for leaderboard display
β βββ app.py # Main Gradio UI
β βββ tasks.py # Background tasks for model evaluation
β βββ data.py # Data loading and processing
β βββ inference.py # Model inference
β βββ phone_metrics.py # Evaluation metrics
βββ img/ # Images for README and other documentation
```
|