Automatic Speech Recognition for Languages of Ethiopia
# Ethio ASR
To run the code, follow the instructions below
### 1. Clone the repo
```shell
clone
github.com
```
### 2. Set up environment variables in .env
Then create an empty `.env` file in the project root:
```env
# Weights & Biases API key
WANDB_API_KEY="wandb_api_key_xxx"
# Hugging Face API key
HF_API_KEY="hf_api_key_xxx"
# Set cache
NUMBA_CACHE_DIR='/tmp/numba_cache'
LIBROSA_CACHE_DIR="/tmp/librosa_cache"
# Hugging Face cache directory
HF_HOME='/project_dir/huggingface_cache'
# MPLCONFIGDIR
MPLCONFIGDIR='/tmp/matplotlib_cache'
```
### 3. Set the YAML config file to run the experiment
This config is under config_files. This config below is for an experiment on a small scale dataset.
```yaml
# Project settings
# this is the WANDB project name
project: "Ethio-ASR"
# this is the output directory for saving the model and processor
output_dir: "inprogress/Ethio-ASR"
# set random seed for reproducibility
seed: 42
# Model settings
pretrained_model: "facebook/w2v-bert-2.0" # or "acebook/mms-300m
freeze_feature_encoder: true
add_final_layer_adapter: true # should be false for facebook/mms-300m
# Training settings
batch_size: 8
gradient_accumulation_steps: 4
num_epochs: 25
max_steps: 18400
learning_rate: 0.00003 # or 0.0005 for "facebook/mms-300m"
warmup_ratio: 0.1
fp16: true
gradient_checkpointing: true
save_steps: 800
eval_steps: 800
logging_steps: 5
save_total_limit: 2
# Data settings
# if use_custom_dataset is true, then dataset_path is the path to the custom dataset on disk
# if use_custom_dataset is false, then dataset_path is the dataset repo name on the HF hub
use_custom_dataset: false
# if from HF hub, use the repo name for example "badrex/waxalNLP-ethiopic-final"
dataset_path: "badrex/waxalNLP-ethiopic-final"
train_split: "train"
eval_split: "validation"
language: "all"
# Data sampling settings (for debugging purposes)
sample: true
sample_size: 197634 # this is the size of the dataset in the HF hub
## Text prep …