Clone
1
Home
Mr.Lee edited this page 2026-11-28 08:00:48 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

whisperX 镜像同步记录与项目分析

维护说明:本页由 gitea-mirror-wiki 技能生成(2026-11-28 08:00),记录该仓库在 GPD Gitea 的镜像状态与代码速览。Wiki 属于本地维护内容,不来自上游,也不受 8 小时同步影响。

一、仓库概况

项目 值
上游 https://github.com/m-bain/whisperX.git
本地镜像 http://192.168.1.99:3000/jarod/whisperX
公网入口 https://git.lxj.ai/jarod/whisperX
状态 活跃镜像(8 小时自动同步)
默认分支 main
仓库大小 约 125.3 MB(DB 131414685 字节;裸仓约 126181 KB)
refs 4 分支 / 46 标签 / HEAD 历史 572 提交
建立时间 2026-11-28 07:53:48
描述 WhisperX 自动镜像:基于 faster-whisper 的词级时间戳对齐、VAD 分段与说话人分离的语音转写工具(上游 m-bain/whisperX)

二、同步过程与当前状态

本次同步实测

项目 结果
上游仓库 https://github.com/m-bain/whisperX (m-bain/whisperX,Python / PyTorch + CUDA,BSD-2-Clause,25.9k star,pyproject 版本 3.8.7rc1)
迁移请求 POST /api/v1/repos/migrate;mirror=true、mirror_interval=8h0m0s、private=false、repo_owner=jarod、repo_name=whisperX
迁移结果 HTTP 201 Created,服务端实测耗时 120.46 s(约 2 分 0 秒),repo id 45,empty=false;上游工作树约 41 MB(GitHub API size=42007 KB),clone --mirror 拉全历史后裸仓约 126 MB
默认分支 main;裸仓 HEAD = 8d8e43bf3698dd1df4b011c0f1a8dd1d468ae365,与 GitHub 上游 main HEAD 一致
refs 规模 4 分支 / 46 标签 / 全 refs 1897 提交(main 单分支历史 572 提交,二者口径不同);裸仓 126148 KB(DB size 131352344 字节 ≈ 128334 KB),git fsck 无异常
origin 配置 https://github.com/m-bain/whisperX.git;fetch = +refs/:refs/ 与 +refs/tags/:refs/tags/ 双条;无残留 http.proxy;属主 jarod:jarod
代理链路 mihomo 127.0.0.1:7890 → gitea-proxy-bridge 0.0.0.0:17890 → 容器 HTTP_PROXY/HTTPS_PROXY 环境变量(gitconfig 对 Gitea 无效)
同步超时配置 app.ini [git.timeout] MIRROR=3600 / MIGRATE=14400(服务端 migrate 硬超时 4 小时,本次 120 s 未触发)
镜像同步验证 POST /repos/jarod/whisperX/mirror-sync → HTTP 200 / 0.097 s;排期 2026-11-28 07:56:26 → 15:56:26(+8h),enable_prune=1
页面与 API 校验 GET /jarod/whisperX → 200;GET /api/v1/repos/jarod/whisperX → 200(empty=false、mirror=true、private=false、size=128334 KB、default_branch=main、status=0)
仓库计数 jarod 下第 30 个仓库(29 个历史 + 本仓库),第 28 个活跃镜像(另有 anqing 静态归档、cn-edu 本地自建非镜像)
大小写说明 DB 规范名 whisperX,Gitea 裸仓目录一律小写 whisperx.git / whisperx.wiki.git;Wiki 技能 --repo 已做大小写归一化,页面 URL 仍用规范名 whisperX
客户端超时说明 本次采用 GPD 宿主侧 nohup 后台 curl(--max-time 7200)+ 服务端判定,规避本机 curl 超时误判;clone 期间 DB 呈 status=1 / is_empty=1 / size=0 / default_branch=main 为正常中间态,clone 完成后 Gitea 自动归位并插入 mirror 排期,全程未重发 migrate

当前校验状态

检查项 结果
is_mirror / is_empty 1 / 0
HEAD refs/heads/main → 8d8e43b
remote.origin.url https://github.com/m-bain/whisperX.git
remote.origin.fetch +refs/*:refs/* / +refs/tags/*:refs/tags/*
自动同步排期 updated 2026-11-28 07:58:08 → next 2026-11-28 15:58:08

页面验证:GET /jarod/whisperX/wiki 返回 200 即表示 Wiki 裸仓已被 Gitea 正确识别。

三、项目功能速览

README 来源:README.md

## Recall.ai - Meeting Transcription API
If you’re looking for a transcription API for meetings, consider checking out [Recall.ai's Meeting Transcription API](https://www.recall.ai/product/meeting-transcription-api?utm_source=github&utm_medium=sponsorship&utm_campaign=mbain-whisperx), an API that works with Zoom, Google Meet, Microsoft Tea
alt="GitHub stars">
alt="GitHub issues">
alt="GitHub license">
alt="ArXiv paper">
This repository provides fast automatic speech recognition (70x realtime with large-v2) with word-level timestamps and speaker diarization.
- ⚡️ Batched inference for 70x realtime transcription using whisper large-v2
- 🪶 [faster-whisper](https://github.com/guillaumekln/faster-whisper) backend, requires <8GB gpu memory for large-v2 with beam_size=5
- 🎯 Accurate word-level timestamps using wav2vec2 alignment
- 👯‍♂️ Multispeaker ASR using speaker diarization from [pyannote-audio](https://github.com/pyannote/pyannote-audio) (speaker ID labels)
- 🗣️ VAD preprocessing, reduces hallucination & batching with no WER degradation
**Whisper** is an ASR model [developed by OpenAI](https://github.com/openai/whisper), trained on a large dataset of diverse audio. Whilst it does produces highly accurate transcriptions, the corresponding timestamps are at the utterance-level, not per word, and can be inaccurate by several seconds. 
**Phoneme-Based ASR** A suite of models finetuned to recognise the smallest unit of speech distinguishing one word from another, e.g. the element p in "tap". A popular example model is [wav2vec2.0](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self).

检出的技术栈 / 构建信号:GitHub Actions CI、Python(现代构建)

顶层目录:.github、(根目录)、figures、tests、whisperx

四、代码功能与安全简析(人工复核)

功能定位

WhisperX 是牛津大学 VGG 组 Max Bain 等人开发的语音识别(ASR)增强工具(INTERSPEECH 2023,Ego4D 转写挑战第一名,25.9k star)。它不重新训练模型,而是在 OpenAI Whisper 之上补齐三件事:

  1. 批量推理加速:以 faster-whisper / CTranslate2 为后端,large-v2 模型约 70× 实时、<8 GB 显存;
  2. 词级时间戳:用 wav2vec2 音素强制对齐(Forced Alignment)把 Whisper 原本只有句级、误差可达数秒的时间戳细化到每个词;
  3. 说话人分离:VAD(silero-vad / pyannote)先切分音频减少幻觉,再由 pyannote-audio 给每段标注 speaker ID。

2026 年新增 interleaved_context 上下文感知批处理,改善长音频的标点与专有名词。典型用途:会议/访谈/视频字幕(SRT、VTT)生成、带说话人标签的转写稿。

技术栈与入口

  • 语言 Python >=3.10,<3.14,打包 pyproject.toml + uv.lock(uv / setuptools),CLI 入口 whisperx = whisperx.__main__:cli,也可 import whisperx 走 Python API。
  • 核心依赖:torch~=2.8.0、torchvision~=0.23.0、ctranslate2>=4.5、faster-whisper>=1.2、transformers>=4.48、pyannote-audio>=4.0、huggingface-hub>=0.28、nltk / omegaconf / pandas / numpy;可选 numba(whisperx[fast] 加速对齐 30–100×)、torchaudio、triton(Linux x86_64)。
  • 安装:pip install whisperx / uvx whisperx / uvx git+https://github.com/m-bain/whisperX.git;GPU 需预装 CUDA 12.8、ffmpeg,CPU 模式用 --compute_type int8 --device cpu。
  • 顶层目录:whisperx/(主包)、tests/、figures/、.github/workflows/(build-and-release / python-compatibility / tests / zizmor)、EXAMPLES.md、CUDNN_TROUBLESHOOTING.md。

安全快检(人工复核)

  • 未发现硬编码凭据:关键词扫描命中集中在三类无害内容 —— ① README / EXAMPLES 中的 --hf_token、YOUR_HF_TOKEN 是占位符,要求用户自行提供 Hugging Face 只读 token 并接受 pyannote/speaker-diarization-community-1 用户协议;② uv.lock 中 tokenizers、hf_xet、huggingface-hub 等依赖名与 sha256 校验串;③ 测试代码里的 fake_processor.tokenizer、dictionary[char] 等变量名。
  • CI 权限收敛良好:build-and-release.yml 顶层 permissions: {},仅 build job 授予 contents: write;actions/checkout 设 persist-credentials: false;所有 action 按 commit SHA 固定版本;GH_TOKEN: ${{ github.token }}、UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} 均为 GitHub Secrets 引用而非明文;另设 zizmor.yml 做 workflow 静态安全扫描。
  • 无敏感文件入库:全树未发现 .env、*.pem / *.p12 / *.key、id_rsa、credentials、.pypirc 等。
  • 无危险安装脚本:未见 curl|sh、wget|sh、sudo、eval();whisperx/audio.py:62 的 subprocess.CalledProcessError 是调用 ffmpeg 解码音频时的异常捕获,属正常用法。
  • 无对外暴露端口、无默认口令、无提权逻辑 —— 它是本地 CLI / 库,不是服务。

风险提示

  1. 模型下载与合规:首次运行会从 Hugging Face / torchaudio 拉取 GB 级模型权重;说话人分离必须自备 HF token 并接受 pyannote 模型协议,离线/内网环境需预先缓存模型。
  2. 环境门槛高:CUDA 12.8 + torch 2.8 + ffmpeg + rust 组合较新,依赖多为 >= 下界且 uv.lock 设了 exclude-newer = "1 week",复现时建议锁定 uv.lock 或用官方镜像,避免依赖漂移。
  3. 上游版本为预发布:3.8.7rc1 属 rc,生产字幕/转写任务建议优先用 PyPI 稳定版;音频内容涉及隐私时应在本地处理,注意不要把素材上传到第三方 API。

结论

高质量、活跃维护的开源 ASR 工具,代码与 CI 卫生状况良好,无明显后门或凭据泄露;作为转写/字幕流水线组件值得试用,主要成本在 GPU 环境与模型准备,而非代码风险。本仓库仅为只读镜像,供离线审阅与归档。

五、代码安全快检(自动)

  • password|secret|token|api_key|private_key|access_key 命中 186 处;此类命中多为变量名、UI 文案或协议字段,需人工复核,不等于存在凭据泄露。
  • 敏感文件(.env / *.pem / *.p12 / 私钥 / credentials 等):未检出
  • 硬编码 PEM 私钥:未检出
  • 危险脚本模式(curl|bash / eval / base64 -d / chmod 777):未检出

六、风险提示

  1. 自动快检只覆盖常见模式,不替代人工审计;部署前核对依赖来源、锁文件与 CI 中的 ${{ secrets.* }} 用法。
  2. 远程控制 / Agent / 文件上传 / 解析外部文档类项目,优先放在内网隔离环境,避免直接暴露公网。
  3. 注意许可证(GPL / AGPL 等)对二次分发与闭源集成的约束。

七、维护约定

  • Gitea 对 is_mirror=1 的仓库禁止 Wiki API / UI 写入(POST .../wiki/pages 返回 405),但读正常;本页由服务端直接维护 <repo>.wiki.git 裸仓。
  • 更新方式:临时 chown -R root:root,用 hash-object -w + mktree + commit-tree + update-ref 提交,最后 chown -R 1000:1000;root 直接 git clone 会触发 dubious ownership。
  • Wiki 是独立裸仓,8 小时 mirror-sync --prune 只操作主裸仓,不会影响本页;删除并重建仓库会连带删除 Wiki,Gitea 迁移/备份时须单独带上 .wiki.git。
  • 每次人工发起的镜像同步完成后,按 gitea-mirror-wiki 技能更新本页;后台自动同步不重复生成。