需先安装 Conda 与 Yarn 才能运行安装脚本;使用 Pyannote 模型需在 Hugging Face 接受三个模型条款并用 token 登录;macOS 上 safetensors 编译失败需先 brew install rust

whisper-playground
saharmorMIT长期未更新基于 OpenAI Whisper 搭建实时语音转文字 Web 应用的开源示例,帮你快速把语音识别能力接入网页端。
Build real time speech2text web apps using OpenAI's Whisper https://openai.com/blog/whisper/
sh install_playground.sh
cd backend && python server.py
cd interface && yarn startREADME 未说明具体显存要求,仅提示需在 config.py 中确认转写设备与计算类型是否匹配本机环境
基于 faster-whisper、Diart 和 Pyannote 搭建实时语音转文字 Web 应用的开源项目
基于 OpenAI Whisper 搭建实时语音转文字 Web 应用的开源示例,帮你快速把语音识别能力接入网页端。
核心能力
- 用 faster-whisper 做多语言实时语音转写
- 用 Diart 与 Pyannote 实现说话人分离
- 提供 React 前端与 Python 后端分离架构
- 可选实时与顺序两种转写模式
- 可调模型大小、语言、超时与 beam size
容易踩的坑
- v1.0.1VAD support最新正式版2023-08-17 · 2023-08-17 15:55 UTC
这个版本没有写更新说明。
- v1.0.02023-08-14 · 2023-08-14 18:41 UTC
查看更新说明
Features
- Real-time streaming via web socket
- Speaker diarization with pyannote.audio
- Context-aware transcription using Whisper's prompting
- Real-time & sequential modes for transcriptions
- Support Whisper large-v2
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
https://github.com/ethanzrd/whisper-playground/assets/79014814/44a9bcf0-e374-4c71-8189-1d99824fbdc5
Setup
- Have
CondaandYarnon your device - Clone or fork this repository
- Install the backend and frontend environment
sh install_playground.sh - Review config.py to make sure the transcription device and compute type match your setup. Review config.js to make sure it conforms to the backend config and that the backend address is correct.
- Run the backend
cd backend && python server.py - In a different terminal, run the React frontend
cd interface && yarn start
Access to Pyannote Models
This repository uses libraries based on pyannote.audio models, which are stored in the Hugging Face Hub. You must accept their terms of use before using them. Note: You need to have a Hugging Face account to use pyannote
- Accept terms for the
pyannote/segmentationmodel - Accept terms for the
pyannote/embeddingmodel - Accept terms for the
pyannote/speaker-diarizationmodel - Install huggingface-cli and log in with your user access token (can be found in Settings -> Access Tokens)
Parameters
- Model Size: Choose the model size, from tiny to large-v2.
- Language: Select the language you will be speaking in.
- Transcription Timeout: Set the number of seconds the application will wait before transcribing the current audio data.
- Beam Size: Adjust the number of transcriptions generated and considered, which affects accuracy and transcription generation time.
- Transcription Method: Choose "real-time" for real-time diarization and transcriptions, or "sequential" for periodic transcriptions with more context.
Troubleshooting
- On MacOS, if building the wheel for safetensors fails, install Rust
brew install rustand try again.
Known Bugs
- In the sequential mode, there may be uncontrolled speaker swapping.
- In real-time mode, audio data not meeting the transcription timeout won't be transcribed.
This repository hasn't been tested for all languages; please create an issue if you encounter any problems.
License
This repository and the code and model weights of Whisper are released under the MIT License.