项目地址#https://github.com/openai/whisper
安装环境
# 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
pip install -U openai-whisper
pip install git+https://github.com/openai/whisper.git
pip install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git
pip install setuptools-rust
示例代码
import whisper
model = whisper.load_model("large")
prompt = f'提示内容'
result = model.transcribe(audio_save_path, initial_prompt=prompt)
print("result:",result["text"])
标签:文字,git,install,whisper,音频,https,pip,ffmpeg
From: https://www.cnblogs.com/pythonywy/p/17730215.html