pip3 install -r ./requirements.txt
It also requires the command-line tool ffmpeg
to be installed on your system, which is available from most package managers:
# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg
# on Arch Linux
sudo pacman -S ffmpeg
# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg
# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg
# on Windows using Scoop (https://scoop.sh/)
scoop install ffmpeg
User Jupyter Notebook to train and store model.
-
Place Your Hugging Face Model: Ensure your Hugging Face model file (e.g., pytorch_model.bin) is saved in a known directory.
-
Run the Script: Use the command line to navigate to the directory containing the script and run it with the necessary arguments.
-
The script requires three arguments: --hf_model_path: Path to the Hugging Face model file. --whisper_model_path: Path where the converted Whisper model should be saved. --model: Size of the Whisper model (options are 'tiny', 'base', 'small', 'medium', 'large').
Here's an example command:
python hf_to_openai_converter.py --hf_model_path "path/to/hf_model.bin" --whisper_model_path "path/to/whisper_model.pt" --model "medium"
python test.py --model "medium" --custom_model_path "path/to/whisper_model.pt" --audio_path "path/to/audio.wav"