whisper-playground

saharmorMIT长期未更新

基于 OpenAI Whisper 搭建实时语音转文字 Web 应用的开源示例,帮你快速把语音识别能力接入网页端。

Build real time speech2text web apps using OpenAI's Whisper https://openai.com/blog/whisper/

v1.0.1发布于 2023-08-17 15:55 UTC836star143fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
sh install_playground.sh
cd backend && python server.py
cd interface && yarn start
硬件要求按 README 说明

README 未说明具体显存要求,仅提示需在 config.py 中确认转写设备与计算类型是否匹配本机环境

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 faster-whisper、Diart 和 Pyannote 搭建实时语音转文字 Web 应用的开源项目

基于 OpenAI Whisper 搭建实时语音转文字 Web 应用的开源示例,帮你快速把语音识别能力接入网页端。

核心能力

  • 用 faster-whisper 做多语言实时语音转写
  • 用 Diart 与 Pyannote 实现说话人分离
  • 提供 React 前端与 Python 后端分离架构
  • 可选实时与顺序两种转写模式
  • 可调模型大小、语言、超时与 beam size

容易踩的坑

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

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

2 个版本v1.0.1
  1. v1.0.1VAD support最新正式版2023-08-17 · 2023-08-17 15:55 UTC

    这个版本没有写更新说明。

  2. 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

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    https://github.com/ethanzrd/whisper-playground/assets/79014814/44a9bcf0-e374-4c71-8189-1d99824fbdc5

    Setup

    1. Have Conda and Yarn on your device
    2. Clone or fork this repository
    3. Install the backend and frontend environment sh install_playground.sh
    4. 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.
    5. Run the backend cd backend && python server.py
    6. 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

    1. Accept terms for the pyannote/segmentation model
    2. Accept terms for the pyannote/embedding model
    3. Accept terms for the pyannote/speaker-diarization model
    4. 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 rust and try again.

    Known Bugs

    1. In the sequential mode, there may be uncontrolled speaker swapping.
    2. 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.