{"id":25330779,"url":"https://github.com/scart97/thunder-speech","last_synced_at":"2025-10-29T05:30:22.055Z","repository":{"id":37459891,"uuid":"332943379","full_name":"scart97/thunder-speech","owner":"scart97","description":"A Hackable speech recognition library.","archived":false,"fork":false,"pushed_at":"2024-10-16T00:12:27.000Z","size":3986,"stargazers_count":25,"open_issues_count":8,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T13:37:27.982Z","etag":null,"topics":["audio","deep-learning","python","pytorch","speech","speech-recognition"],"latest_commit_sha":null,"homepage":"https://scart97.github.io/thunder-speech/","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/scart97.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-01-26T02:09:21.000Z","updated_at":"2024-04-12T13:43:17.000Z","dependencies_parsed_at":"2023-11-16T22:06:40.723Z","dependency_job_id":null,"html_url":"https://github.com/scart97/thunder-speech","commit_stats":{"total_commits":452,"total_committers":3,"mean_commits":"150.66666666666666","dds":0.1084070796460177,"last_synced_commit":"122baa3726c567700b219399f023b11269b001d5"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scart97%2Fthunder-speech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scart97%2Fthunder-speech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scart97%2Fthunder-speech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scart97%2Fthunder-speech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scart97","download_url":"https://codeload.github.com/scart97/thunder-speech/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238773077,"owners_count":19528052,"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":["audio","deep-learning","python","pytorch","speech","speech-recognition"],"created_at":"2025-02-14T03:23:21.112Z","updated_at":"2025-10-29T05:30:21.292Z","avatar_url":"https://github.com/scart97.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/scart97/thunder-speech/branch/master/graph/badge.svg?token=USCEGEGM3D)](https://codecov.io/gh/scart97/thunder-speech)\n![Test](https://github.com/scart97/thunder-speech/workflows/Test/badge.svg)\n[![docs](https://img.shields.io/badge/docs-read-informational)](https://scart97.github.io/thunder-speech/)\n\n# Thunder speech\n\n\u003e A Hackable speech recognition library.\n\nWhat to expect from this project:\n\n- End-to-end speech recognition models\n- Simple fine-tuning to new languages\n- Inference support as a first-class feature\n- Developer oriented api\n\nWhat it's not:\n\n- A general-purpose speech toolkit\n- A collection of complex systems that require thousands of gpu-hours and expert knowledge, only focusing on the state-of-the-art results\n\n\n## Quick usage guide\n\n### Install\n\nInstall the library from PyPI:\n\n```\npip install thunder-speech\n```\n\n\n### Load the model and train it\n\n```py\nfrom thunder.registry import load_pretrained\nfrom thunder.quartznet.compatibility import QuartznetCheckpoint\n\n# Tab completion works to discover other QuartznetCheckpoint.*\nmodule = load_pretrained(QuartznetCheckpoint.QuartzNet5x5LS_En)\n# It also accepts the string identifier\nmodule = load_pretrained(\"QuartzNet5x5LS_En\")\n# Or models from the huggingface hub\nmodule = load_pretrained(\"facebook/wav2vec2-large-960h\")\n```\n\n### Export to a pure pytorch model using torchscript\n\n```py\nmodule.to_torchscript(\"model_ready_for_inference.pt\")\n\n# Optional step: also export audio loading pipeline\nfrom thunder.data.dataset import AudioFileLoader\n\nloader = AudioFileLoader(sample_rate=16000)\nscripted_loader = torch.jit.script(loader)\nscripted_loader.save(\"audio_loader.pt\")\n```\n\n### Run inference in production\n\n``` python\nimport torch\nimport torchaudio\n\nmodel = torch.jit.load(\"model_ready_for_inference.pt\")\nloader = torch.jit.load(\"audio_loader.pt\")\n# Open audio\naudio = loader(\"audio_file.wav\")\n# transcriptions is a list of strings with the captions.\ntranscriptions = model.predict(audio)\n```\n\n## More quick tips\n\nIf you want to know how to access the raw probabilities and decode manually or fine-tune the models you can access the documentation [here](https://scart97.github.io/thunder-speech/quick%20reference%20guide/).\n\n## Contributing\n\nThe first step to contribute is to do an editable installation of the library:\n\n```\ngit clone https://github.com/scart97/thunder-speech.git\ncd thunder-speech\npoetry install\npre-commit install\n```\n\nThen, make sure that everything is working. You can run the test suit, that is based on pytest:\n\n```\nRUN_SLOW=1 poetry run pytest\n```\n\nHere the `RUN_SLOW` flag is used to run all the tests, including the ones that might download checkpoints or do small training runs and are marked as slow. If you don't have a CUDA capable gpu, some tests will be unconditionally skipped.\n\n\n## Influences\n\nThis library has heavy influence of the best practices in the pytorch ecosystem.\nThe original model code, including checkpoints, is based on the NeMo ASR toolkit.\nFrom there also came the inspiration for the fine-tuning and prediction api's.\n\nThe data loading and processing is loosely based on my experience using fast.ai.\nIt tries to decouple transforms that happen at the item level from the ones that are efficiently implemented for the whole batch at the GPU.\nAlso, the idea that default parameters should be great.\n\nThe overall organization of code and decoupling follows the pytorch-lightning ideals, with self-contained modules that try to reduce the boilerplate necessary.\n\nFinally, the transformers library inspired the simple model implementations, with a clear separation in folders containing the specific code that you need to understand each architecture and preprocessing, and their strong test suit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscart97%2Fthunder-speech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscart97%2Fthunder-speech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscart97%2Fthunder-speech/lists"}