GUI and API for OpenAI Whisper
Add a new transcribe job to the queue. The job will be processed by the worker asynchroniously.
The response will be a JSON object with job_id
that can be used to check the status of the job.
Query parameters:
- REQUIRED:
email_callback
: string - OPTIONAL:
language
: string (default: automatic detection) - OPTIONAL:
model
: string (default:tiny
) - OPTIONAL:
task
: string (default:transcribe
)transcribe
: Transcribe audio to texttranslate
: Transcribe then translate audio to text
- OPTIONAL:
filename
: string (default:untitled-transcription
)
Body:
- REQUIRED:
binary data
: Raw data with the audio content to transcribe
Get the available options for the transcribe route.
Detect the language of the audio file.
Query parameters:
- OPTIONAL:
model
: string (default:tiny
)
Body:
- REQUIRED:
binary data
: Raw data with the audio content to detect the language for
Get the available options for the detect route.
Receive the finished job result as the requested output format.
Query parameters:
- OPTIONAL:
output
: string (default:srt
)json
: JSON response of the model outputtimecode_txt
: Plain text file with timecodes(srt)txt
: Plain text file of the detected textvtt
: WebVTT file with the detected textsrt
: WebVTT file with the detected text
Get the available options for the download route.
Get the status and metadata of the provided job.
Get the available length of the queue as JSON object with the key length
.
Required amount of VRAM depends on the model used. The smallest model is tiny
which requires about 1GB of VRAM.
You can see the full list of models here with information about the required VRAM.
The codebase is expected to be compatible with Python 3.8-3.10. This would be the same as the OpenAI Whisper requirements.
python3 -mvenv .venv
source .venv/bin/activate
pip install -r requirements.txt
First create a .envrc
file with the following content:
export BASE_URL=https://example.com
export [email protected]
export EMAIL_SENDER_PASSWORD=example
export EMAIL_SENDER_HOST=smtp.example.com
export DISCLAIMER='This is a <a href="example.com">disclaimer</a>'
Then run the following command
docker-compose --env-file .envrc up
This will start three docker containers.
- redis
- api running flask fra src
- worker running rq from src
Install remote-development extensions (containers)
And then in vscode do Devcontainers: open folder in container
Then you are inside the api-container and can do stuff
To upload a file called audunspodssounds.mp3 in norwegian from your download directory
curl --location --request POST 'localhost:5000/v1/transcribe?output=vtt' \
--header 'Content-Type: audio/mpeg' \
--data-binary '@/Users/<user>/Downloads/audunspodssounds.mp3'
$ pytest
How to fix [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
?
$ /Applications/Python\ 3.7/Install\ Certificates.command