- Platform: MacOS-14.1-arm64-arm-64bit (M2)
- Python 3.11.5
- pip 23.3.1
- setuptools 68.2.2
- ffmpeg 6.1.0
-
Clone it.
git clone git@github.com:TheLanguageArchive/whisper_standalone_executable.git --depth 1 -
cd whisper_standalone_executable/whisper -
mkdir -p docs/mac/logs/ ; conda list > docs/mac/logs/transcriber_cli_env_mac_base.txt -
Create Anaconda (Conda) Environment :
transcriber_cli_env_mac_202312211128 -
conda create --name transcriber_cli_env_mac_202312211128 python=3.11.5 -y -
Select the created Python Environment in the
PyCharm/Terminalconda activate transcriber_cli_env_mac_202312211128mkdir -p docs/mac/logs/ ; conda list > docs/mac/logs/transcriber_cli_env_mac_202312211128_init.txt
-
Install Pre-req Dependencies:
pip install -r requirements.txtconda install -c conda-forge ffmpeg=6.1.0 -y
-
mkdir -p docs/mac/logs/ ; conda list > docs/mac/logs/transcriber_cli_env_mac_202312211128_final.txt
rm -r build &&
rm -r dist &&
rm -r whisper_transcriptions &&
rm transcriber_cli_mac_001202312211131.spec
From whisper project root folder.
python cli.py ./../transcriber_jar/src/test/resources/videos/testFile202312061352.mp4 --fp16=False --model=large-v3 --language=en --output_format=json --output_dir=./whisper_transcriptions/ --word_timestamps=True
Create the executable(s) file in dist directory that can be run from the command line:
Notes:
- osPathsSeparator
: - versionWithoutDots
pyinstaller cli.py \
--noconsole \
--onefile \
--clean \
--log-level=DEBUG \
--argv-emulation \
--name transcriber_cli_mac_001202312211131 \
--add-data "whisper/assets/*":whisper/assets \
--add-binary ~/anaconda3/envs/transcriber_cli_env_mac_202312211128/bin/ffmpeg:bin \
--add-binary ~/anaconda3/envs/transcriber_cli_env_mac_202312211128/bin/ffprobe:bin
OR pre-pend following line to the *.spec file import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)
And then
pyinstaller --clean --log-level=DEBUG transcriber_cli_mac_001202312211131.spec
For testing from the project root directory transcriber_cli execute the following command:
"dist/transcriber_cli_mac_001202312211131" ./../transcriber_jar/src/test/resources/videos/testFile202312061352.mp4 --fp16=False --model=large-v3 --language=en --output_format=json --output_dir=./whisper_transcriptions/ --word_timestamps=True
mkdir -p ./../transcriber_jar/src/main/resources/releases/ ; \
cp "./dist/transcriber_cli_mac_001202312211131" "./../transcriber_jar/src/main/resources/releases/transcriber_cli_mac_001202312211131"
conda deactivate
In whisper directory
"./../transcriber_jar/src/main/resources/releases/transcriber_cli_mac_001202312211131" ./../transcriber_jar/src/test/resources/videos/testFile202312061352.mp4 --fp16=False --model=large-v3 --language=en --output_format=json --output_dir=./whisper_transcriptions/ --word_timestamps=True
Transcription files will be created.
NOTE: Ideally, we should be able to assume that after installation if this is the first file copied and ran. It should work. While the executable tries to package everything it needs there are still some libraries which are expected to be present in the host system.
Cache location: ~/.cache/whisper/