{"id":21529607,"url":"https://github.com/sooftware/accelerate-asr","last_synced_at":"2025-04-09T23:51:42.320Z","repository":{"id":51394920,"uuid":"365936459","full_name":"sooftware/accelerate-asr","owner":"sooftware","description":"Modular and extensible speech recognition library leveraging accelerate and hydra.","archived":false,"fork":false,"pushed_at":"2021-05-12T07:04:26.000Z","size":86,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T23:51:37.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sooftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-10T06:11:32.000Z","updated_at":"2024-08-28T02:25:02.000Z","dependencies_parsed_at":"2022-09-02T07:11:57.000Z","dependency_job_id":null,"html_url":"https://github.com/sooftware/accelerate-asr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sooftware%2Faccelerate-asr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sooftware%2Faccelerate-asr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sooftware%2Faccelerate-asr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sooftware%2Faccelerate-asr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sooftware","download_url":"https://codeload.github.com/sooftware/accelerate-asr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131454,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:58:21.025Z","updated_at":"2025-04-09T23:51:42.293Z","avatar_url":"https://github.com/sooftware.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003ch1 align=\"center\"\u003eAccelerate ASR\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n**Modular and extensible speech recognition library leveraging [accelerate](https://github.com/huggingface/accelerate) and [hydra](https://github.com/facebookresearch/hydra)**\n\n  \n---\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/sooftware/accelerate-asr#introduction\"\u003eWhat is Accelerate ASR\u003c/a\u003e •\n  \u003ca href=\"https://github.com/sooftware/accelerate-asr#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"https://github.com/sooftware/accelerate-asr#get-started\"\u003eGet Started\u003c/a\u003e •\n  \u003ca href=\"https://www.codefactor.io/repository/github/sooftware/accelerate-asr\"\u003eCodefactor\u003c/a\u003e •\n  \u003ca href=\"https://github.com/sooftware/accelerate-asr/blob/main/LICENSE\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\u003c/div\u003e\n    \n## Introduction\n    \n[Accelerate](https://github.com/huggingface/accelerate) was created for PyTorch users who like to write the training loop of PyTorch models but are reluctant to write and maintain the boilerplate code needed to use multi-GPUs/TPU/fp16. Accelerate abstracts exactly and only the boilerplate code related to multi-GPUs/TPU/fp16 and leaves the rest of your code unchanged.  \n  \nThis project is an example that implements the asr project with Accelerate. In this project, I trained a model consisting of a conformer encoder + LSTM decoder with Joint CTC-Attention. I hope this could be a guideline for those who research speech recognition.  \n  \n## Installation\n  \nThis project recommends Python 3.7 or higher.  \nI recommend creating a new virtual environment for this project (using virtual env or conda).\n  \n\n### Prerequisites\n  \n* numpy: `pip install numpy` (Refer [here](https://github.com/numpy/numpy) for problem installing Numpy).\n* pytorch: Refer to [PyTorch website](http://pytorch.org/) to install the version w.r.t. your environment.   \n* librosa: `conda install -c conda-forge librosa` (Refer [here](https://github.com/librosa/librosa) for problem installing librosa)\n* torchaudio: `pip install torchaudio==0.6.0` (Refer [here](https://github.com/pytorch/pytorch) for problem installing torchaudio)\n* sentencepiece: `pip install sentencepiece` (Refer [here](https://github.com/google/sentencepiece) for problem installing sentencepiece)\n* accelerate: `pip install accelerate` (Refer [here](https://github.com/huggingface/accelerate) for problem installing accelerate)\n* hydra: `pip install hydra-core --upgrade` (Refer [here](https://github.com/facebookresearch/hydra) for problem installing hydra)\n  \n### Install from source\nCurrently I only support installation from source code using setuptools. Checkout the source code and run the   \nfollowing commands:  \n```\n$ pip install -e .\n$ ./setup.sh\n```\n  \n### Install Apex (for 16-bit training) \n  \nFor faster training install NVIDIA's apex library:\n  \n```\n$ git clone https://github.com/NVIDIA/apex\n$ cd apex\n\n# ------------------------\n# OPTIONAL: on your cluster you might need to load CUDA 10 or 9\n# depending on how you installed PyTorch\n\n# see available modules\nmodule avail\n\n# load correct CUDA before install\nmodule load cuda-10.0\n# ------------------------\n\n# make sure you've loaded a cuda version \u003e 4.0 and \u003c 7.0\nmodule load gcc-6.1.0\n\n$ pip install -v --no-cache-dir --global-option=\"--cpp_ext\" --global-option=\"--cuda_ext\" ./\n```\n  \n## Get Started\n  \nI use [Hydra](https://github.com/facebookresearch/hydra) to control all the training configurations. If you are not familiar with Hydra I recommend visiting the [Hydra website](https://hydra.cc/). Generally, Hydra is an open-source framework that simplifies the development of research applications by providing the ability to create a hierarchical configuration dynamically.\n  \n### Download LibriSpeech dataset\n  \nYou have to download [LibriSpeech](https://www.openslr.org/12) dataset that contains 1000h English speech corpus. But you can download simply by `dataset_download` option. If this option is True, download the dataset and start training. If you already have a dataset, you can set option `dataset_download` to False and specify `dataset_path`.\n  \n### Training Speech Recognizer\n  \nYou can simply train with LibriSpeech dataset like below:  \n  \n- Example1: Train the `conformer-lstm` model with `filter-bank` features on GPU.\n  \n```\n$ python ./bin/main.py \\\ndata=default \\\ndataset_download=True \\\naudio=fbank \\\nmodel=conformer_lstm \\\nlr_scheduler=reduce_lr_on_plateau \\\ntrainer=gpu\n```\n\n- Example2: Train the `conformer-lstm` model with `mel-spectrogram` features On TPU:\n  \n```\n$ python ./bin/main.py \\\ndata=default \\\ndataset_download=True \\\naudio=melspectrogram \\\nmodel=conformer_lstm \\\nlr_scheduler=reduce_lr_on_plateau \\\ntrainer=tpu\n```\n \n## Troubleshoots and Contributing\nIf you have any questions, bug reports, and feature requests, please [open an issue](https://github.com/sooftware/lightning-asr/issues) on Github.   \n  \nI appreciate any kind of feedback or contribution.  Feel free to proceed with small issues like bug fixes, documentation improvement.  For major contributions and new features, please discuss with the collaborators in corresponding issues.  \n  \n### Code Style\nI follow [PEP-8](https://www.python.org/dev/peps/pep-0008/) for code style. Especially the style of docstrings is important to generate documentation. \n  \n### License\nThis project is licensed under the MIT LICENSE - see the [LICENSE.md](https://github.com/sooftware/lightning-asr/blob/master/LICENSE) file for details\n  \n## Author\n  \n* Soohwan Kim [@sooftware](https://github.com/sooftware)\n* Contacts: sh951011@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsooftware%2Faccelerate-asr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsooftware%2Faccelerate-asr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsooftware%2Faccelerate-asr/lists"}