Audio processor: fix segment detection with transcript-driven breaks

- Add transcript break phrase detection (going_to_break/coming_back cues)
- Create segments from transcript breaks with silence boundary snapping
- Fix segment dedup in merge_adjacent (handle overlapping segments)
- Add CUDA 12 library path fix (gpu.py + venv activate hook)
- Auto-load existing transcript in detect command
- Tested on 2011-03-05 HR1: correctly identifies commercial break at 34:38

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 11:59:54 -07:00
parent a1e0442d8b
commit 87f5a9306a
3 changed files with 215 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
"""GPU and CUDA library setup for the audio processor."""
import os
from pathlib import Path
def ensure_cuda_libs():
"""Ensure CUDA 12 libraries are on LD_LIBRARY_PATH.
The system has CUDA 13.2 but faster-whisper's ctranslate2 needs CUDA 12.
Ollama ships CUDA 12 libs at /usr/local/lib/ollama/cuda_v12/.
"""
cuda12_path = "/usr/local/lib/ollama/cuda_v12"
if Path(cuda12_path).exists():
current = os.environ.get("LD_LIBRARY_PATH", "")
if cuda12_path not in current:
os.environ["LD_LIBRARY_PATH"] = f"{cuda12_path}:{current}" if current else cuda12_path