Files
teams-whisper/app/common.py
T
pinokioandClaude Opus 5.5 4ff3e6fe14 Add Pinokio launcher for Teams meeting report pipeline
Pipeline code copied into app/; llama.py now uses launcher-local
llama.cpp (app/bin) and Qwen GGUF (app/models) instead of LM Studio.
install.js fetches ffmpeg, 7zip, llama.cpp CUDA 13, sherpa-onnx
diarization models, bge-m3 and Qwen3.6-35B-A3B, then pre-builds the
uv script environments. start.js serves the GUI on fixed port 18765
(hardcoded in the browser extension). reset.js keeps app/out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:29:33 +01:00

20 lines
772 B
Python

import glob, os, site
import numpy as np
# pip nvidia-* wheels ship cublas/cudnn DLLs; ctranslate2 needs them on PATH (Windows)
for sp in site.getsitepackages():
for b in glob.glob(os.path.join(sp, "nvidia", "*", "bin")):
os.add_dll_directory(b); os.environ["PATH"] = b + os.pathsep + os.environ["PATH"]
from faster_whisper import WhisperModel
def load_model(name):
"""CUDA if it really works (probe one decode), else CPU int8."""
try:
m = WhisperModel(name, device="cuda", compute_type="float16")
list(m.transcribe(np.zeros(16000, np.float32))[0])
return m, "cuda"
except Exception as e:
print("cuda failed, using cpu:", e, flush=True)
return WhisperModel(name, device="cpu", compute_type="int8"), "cpu"