/whisper

Robust Speech Recognition via Large-Scale Weak Supervision

Primary LanguagePythonMIT LicenseMIT



Whisper
(English/Japanese/Multi-lingual)

ModulesCode structureInstalling the applicationMakefile commandsEnvironmentsDatasetRunning the applicationNotes

Modules

At a granular level, whisper is a library that consists of the following components:

Component Description
whisper Speech Recognition package
whisper.infer whisper Inference from audio files
whisper.tests Unittests

Code structure

import os

import pkg_resources
from setuptools import setup, find_packages
from whisper import __version__

setup(
    name="whisper",
    py_modules=["whisper"],
    version=__version__,
    description="Robust Speech Recognition via Large-Scale Weak Supervision",
    long_description="".join(open("README.md", "r").readlines()),
    long_description_content_type="text/markdown",
    readme="README.md",
    python_requires=">=3.7",
    author="OpenAI, CADIC Jean Maximilien",
    include_package_data=True,
    package_data={"": ["*.flac", "*.txt", "*.json", "*.npz"]},
    url="https://github.com/openai/whisper",
    license="MIT",
    packages=find_packages(),
    install_requires=[
        str(r)
        for r in pkg_resources.parse_requirements(
            open(os.path.join(os.path.dirname(__file__), "requirements.txt"))
        )
    ],
    entry_points={
        "console_scripts": ["whisper=whisper.transcribe:cli"],
    },
)

Installing the application

To clone and run this application, you'll need the following installed on your computer:

Install bpd:

# Clone this repository and install the code
git clone https://github.com/JeanMaximilienCadic/whisper

# Go into the repository
cd whisper

Makefile commands

Exhaustive list of make commands:

build_dockers       # Build the docker images 
sandbox             # Launch a sandbox
tests               # Test the code

Environments

Install PyTorch Install Nvidia Docker2

Docker

Note

Running this application by using Docker is recommended.

To build and run the docker image

make build_dockers
make sandbox

PythonEnv

Warning

Running this application by using PythonEnv is possible but not recommended.

pip install dist/*.whl

Test

make tests

Pretrained model

python -m whisper.infer --audio_path <PATH TO AUDIO FILE (EN/JA/Others)>

Acknowledgements

Thanks to Jong Wook Kim and OpenAI for their contributions!

This is a fork from https://github.com/openai/whisper.

For any question please contact me at j.cadic[at]protonmail.ch