add whisperx support

This commit is contained in:
Mariano Gabriel
2025-12-02 02:33:39 -03:00
parent 118ef04223
commit 7b919beda6
4 changed files with 155 additions and 38 deletions

View File

@@ -184,10 +184,10 @@ class ProcessingWorkflow:
logger.info("STEP 0: Running Whisper Transcription")
logger.info("=" * 80)
# Check if whisper is installed
if not shutil.which("whisper"):
logger.error("Whisper is not installed. Install it with: pip install openai-whisper")
raise RuntimeError("Whisper not installed")
# Check if whisperx is installed
if not shutil.which("whisperx"):
logger.error("WhisperX is not installed. Install it with: pip install whisperx")
raise RuntimeError("WhisperX not installed")
# Unload Ollama model to free GPU memory for Whisper (if using vision)
if self.config.use_vision:
@@ -199,16 +199,17 @@ class ProcessingWorkflow:
except Exception as e:
logger.warning(f"Could not unload Ollama model: {e}")
logger.info(f"Running Whisper transcription (model: {self.config.whisper_model})...")
logger.info(f"Running WhisperX transcription with diarization (model: {self.config.whisper_model})...")
logger.info("This may take a few minutes depending on video length...")
# Run whisper command
# Run whisperx command with diarization
cmd = [
"whisper",
"whisperx",
str(self.config.video_path),
"--model", self.config.whisper_model,
"--output_format", "json",
"--output_dir", str(self.output_mgr.output_dir)
"--output_dir", str(self.output_mgr.output_dir),
"--diarize",
]
try: