# 권장: conda activate stt 후 설치 (프로젝트 기본 환경) # whisper_stt.py (OpenAI Whisper CLI) — 선택 설치 # # ── Ubuntu/Linux 권장 순서 (torch 깨짐·OSError 방지) ───────────────────────── # pyannote가 pip로 torch를 덮어쓰다가 기존 torch와 꼬이면 # "Could not install ... ATen.h" 같은 오류가 날 수 있습니다. # # 1) 새 환경에서 PyTorch를 conda로 먼저 깔고, 그다음 pip: # conda create -n stt python=3.11 -y # conda activate stt # conda install pytorch torchaudio cpuonly -c pytorch -y # pip install -r requirements-whisper-stt.txt # # 2) 이미 깨진 경우(위 오류가 난 뒤) 복구: # conda activate stt # 또는 ncue 등 해당 env # pip uninstall -y torch torchvision torchaudio functorch # pip uninstall -y torch torchvision torchaudio functorch # Skipping만 나올 때까지 반복 # pip cache purge # pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu # pip install -r requirements-whisper-stt.txt # # 3) 2)를 해도 "ATen.h" / OSError 가 나면 — site-packages 에 깨진 torch 잔여 디렉터리가 남은 경우: # conda activate # pip uninstall -y torch torchvision torchaudio functorch 2>/dev/null; true # rm -rf "$CONDA_PREFIX/lib/python3.11/site-packages/torch" \ # "$CONDA_PREFIX/lib/python3.11/site-packages/torch-"*.dist-info \ # "$CONDA_PREFIX/lib/python3.11/site-packages/torchaudio" \ # "$CONDA_PREFIX/lib/python3.11/site-packages/torchaudio-"*.dist-info \ # "$CONDA_PREFIX/lib/python3.11/site-packages/torchgen" \ # "$CONDA_PREFIX/lib/python3.11/site-packages/functorch" # (Python 버전이 3.12면 경로의 python3.11 을 python3.12 로 바꿀 것) # pip cache purge # pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu # pip install -r requirements-whisper-stt.txt # # 4) 그래도 안 되면: conda create -n stt-whisper python=3.11 -y 후 1)부터 새 env에만 설치 # # GPU(CUDA) 쓰는 경우: https://pytorch.org/get-started/locally/ 에서 맞는 pip/conda 명령 사용 # # CLI: PATH에 hf — pip install huggingface_hub 후 hf auth login # # 모델: hf download pyannote/speaker-diarization-3.1 --local-dir ./models/pyannote-diarization-3.1 # (약관 동의·토큰 필요). whisper_stt.py 기본이 이 로컬 폴더 사용. # 403 시: 아래 저장소를 *각각* 웹에서 동의(같은 HF 계정) 후 Read 토큰 / hf auth login # https://hf.co/pyannote/speaker-diarization-3.1 # https://hf.co/pyannote/segmentation-3.0 # https://hf.co/pyannote/speaker-diarization-community-1 (xvec_transform.npz) # hf auth whoami 로 토큰 계정 확인. 동의 후 새 토큰 발급 권장. # ───────────────────────────────────────────────────────────────────────────── openai-whisper imageio-ffmpeg huggingface_hub>=0.26.0 pyannote.audio>=3.1.0