This project provides a custom API wrapper for the open-source Whisper model using FastAPI. It allows you to integrate Whisper into your applications for automatic speech recognition (ASR) tasks.
- Docker installed
- docker-compose installed
git clone https://github.com/valiantlynx/custom-whisper-api.git
cd custom-whisper-apidocker-compose up --build -dThis command builds and starts the Docker containers in the background.
docker-compose downUse this command to stop and remove the Docker containers.
Once the containers are up and running, you can access the FastAPI documentation to understand and test the API endpoints.
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Submit an audio file for automatic speech recognition.
Request:
- Method: POST
- Endpoint:
/asr - Body: Audio file (multipart/form-data)
Response:
- Status Code: 200 OK
- Body: Transcription result
The API utilizes environment variables for configuration. You can customize these variables in the .env file.
WHISPER_MODEL_PATH: Path to the Whisper model directory.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.