able to re-transcribe

This commit is contained in:
2026-05-04 23:54:14 -06:00
parent 137dc80cde
commit 1678d28db7
8 changed files with 346 additions and 9 deletions

View File

@ -48,11 +48,11 @@ def _load_model(model_name: str, device: torch.device):
compute_type = "float16" if device.type == "cuda" else "int8"
model = whisperx.load_model(
model_name,
device=str(device),
device=device.type, # use "cuda" not "cuda:0" — some WhisperX versions don't support device ordinal
compute_type=compute_type,
)
else:
model = whisper.load_model(model_name, device=device)
model = whisper.load_model(model_name, device=str(device))
_model_cache[cache_key] = model
return model
@ -112,7 +112,7 @@ def _transcribe_whisperx(model, audio_path: str, device: torch.device, language:
align_model, align_metadata = whisperx.load_align_model(
language_code=detected_language,
device=str(device),
device=device.type,
)
aligned = whisperx.align(
result["segments"],