Skip to content

Torfinhell/ASR_Conformer

Repository files navigation

Automatic Speech Recognition (ASR) with PyTorch

AboutInstallationHow To UseCreditsLicense

About

This repository contains a solution for solving ASR task with PyTorch

See the task assignment here.

Installation

Follow these steps to install the project:

  1. (Optional) Create and activate new environment using conda.

    a. conda version:

    # create env
    conda create -n hifi_gan python=3.11
    # activate env
    conda activate hifi_gan
  2. Install all required packages

    pip install uv
    uv sync
  3. Install pre-commit:

    pre-commit install

How To Use

To download models checkpoints and test dataset run following:

!uv run scripts/download_gdrive.py

How To Use

To train best model, run the following commands:

uv run train.py HYDRA_CONFIG_ARGUMENTS -cn=train_clean_360_1

and then to finetune afterwards:

uv run train.py +trainer.from_pretrained=PREV_CHECKPOINT OTHER_HYDRA_CONFIG_ARGUMENTS -cn=train_other_500_2

How To Inference and Evaluate

To evaluate the model run:

!uv run inference.py \
   inferencer.from_pretrained={model_path} text_encoder=CTCEncoder \
   inferencer.save_path={output_dir} text_encoder.beam_size=100 \
   -cn=inference_all_metrics

To save predictions run:

!uv run inference.py dataloader=onebatchtest \
            inferencer.dataset_dir={dataset_dir} \
            inferencer.from_pretrained={model_path} \
            inferencer.save_path={gt_name} \
            text_encoder=CTCEncoder -cn=inference

Credits

This repository is based on a PyTorch Project Template.

License

License

About

Implementation of Conformer for the audio course in hse

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors