This project uses faster-whisper and the Ivrit.ai model to transcribe audio/video files.
- uv (An extremely fast Python package installer and resolver)
-
Make sure
uvis installed. -
Clone this repository (if not already done).
-
The environment and dependencies will be automatically handled by
uvwhen you run the script. -
Create a
.envfile in the project root to store your configuration:HF_TOKEN=your_hugging_face_token
Note: The
HF_TOKENis required for speaker diarization (the process of separating audio into different speakers). It is used only to verify that you have accepted the user agreement for thepyannote/speaker-diarization-3.1model on Hugging Face. No sensitive data is accessed or shared. You must accept the agreement here: https://huggingface.co/pyannote/speaker-diarization-3.1
To run the transcription script, use uv run:
uv run transcribe.py path/to/media_fileTo transcribe all media files in a directory:
uv run transcribe.py path/to/folderSupported extensions: .mkv, .mp4, .m4a, .mov, .amr, .wav, .mp3, .flac, .opus.
| Flag | Description | Default |
|---|---|---|
--diarize |
Enable speaker diarization (requires HF_TOKEN) |
False |
--timestamps |
Include timestamps in output ([HH:MM:SS]) |
False |
--model |
Whisper model size/name | ivrit-ai/whisper-large-v3-turbo-ct2 |
--language |
Language code (use auto for detection) |
he |
--device |
Compute device (cuda or cpu) |
Auto-detected |
Simple example:
uv run transcribe.py interview.mp3Example with diarization (different speakers identification):
uv run transcribe.py --diarize interview.mp3Note: Transcription outputs are saved as .txt files in the same directory as the source media.
This project relies heavily on the incredible work of Ivrit.ai.
Ivrit.ai is a non-profit organization dedicated to making Hebrew AI accessible to everyone. The default model used in this script (ivrit-ai/whisper-large-v3-turbo-ct2) is one of their state-of-the-art models. We deeply appreciate their contribution to the open-source community and their mission to advance Hebrew language technology.
This project is licensed under the MIT License - see the LICENSE file for details.