Newer
Older
speech_recognition / pyproject.toml
[project]
name = "speech-recognition"
version = "0.1.0"
description = "長時間の手術中音声 (mp3) をローカル音声認識モデルで文字起こしし、精度・処理時間を比較するツール"
readme = "README.md"
authors = [
    { name = "T.Nakaguchi", email = "nakaguchi@faculty.chiba-u.jp" }
]
# onnxruntime / sentencepiece 等が 3.15 の wheel を未提供のため 3.13 を使用
requires-python = ">=3.11,<3.14"
dependencies = [
    "numpy>=1.26",
    "rapidfuzz>=3.9",
    "tqdm>=4.66",
    # VAD・ReazonSpeech・SenseVoice・Parakeet-ja・話者分離 (トークン不要) の実行基盤
    "sherpa-onnx>=1.12",
    # GPU メモリ使用量の計測
    "nvidia-ml-py>=12.560",
]

[project.optional-dependencies]
whisper = ["openai-whisper>=20250625", "torch>=2.9"]
# CUDA 12 系ランタイム: CTranslate2 (faster-whisper) と sherpa-onnx CUDA 版 (onnxruntime) が使う
# (PyTorch 側の CUDA 13 とは別に導入。cuBLAS の Windows 向け wheel は 12.9.2 まで)
cuda12 = [
    "nvidia-cublas-cu12>=12.8,<12.9.3",
    "nvidia-cudnn-cu12>=9.5,<10",
    "nvidia-cufft-cu12>=11.3",
    "nvidia-cuda-runtime-cu12>=12.8",
    "nvidia-curand-cu12>=10.3",
]
faster-whisper = ["faster-whisper>=1.2", "speech-recognition[cuda12]"]
kotoba = ["transformers>=4.48", "accelerate>=1.0", "torch>=2.9"]
pyannote = ["pyannote-audio>=4.0", "torch>=2.9", "torchaudio>=2.9"]
all = ["speech-recognition[whisper,faster-whisper,kotoba,pyannote,cuda12]"]

[project.scripts]
speech-recognition = "speech_recognition.cli:main"

[build-system]
requires = ["uv_build>=0.13.7,<0.14.0"]
build-backend = "uv_build"

# RTX 50 シリーズ (Blackwell, sm_120) 対応の CUDA 13.0 版 PyTorch を使う
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true

[tool.uv.sources]
torch = { index = "pytorch-cu130" }
torchaudio = { index = "pytorch-cu130" }
# sherpa-onnx の CUDA 12 / cuDNN 9 版 (公式配布: https://k2-fsa.github.io/sherpa/onnx/cuda.html)
# Windows + Python 3.13 用。他環境では PyPI の CPU 版を使う
sherpa-onnx = { url = "https://huggingface.co/csukuangfj2/sherpa-onnx-wheels/resolve/main/cuda/2.0.1/sherpa_onnx-2.0.1+cuda12.cudnn9-cp313-cp313-win_amd64.whl", marker = "sys_platform == 'win32' and python_version == '3.13'" }