able to re-transcribe
This commit is contained in:
@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user