mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 06:26:03 +00:00
Transcribe on GPU
This commit is contained in:
parent
ba3f3cd54b
commit
2448c6f749
@ -130,7 +130,9 @@ def transcribe(
|
||||
decode_options["fp16"] = False
|
||||
|
||||
# Pad 30-seconds of silence to the input audio, for slicing
|
||||
mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)
|
||||
mel = log_mel_spectrogram(
|
||||
audio, model.dims.n_mels, padding=N_SAMPLES, device=model.device
|
||||
)
|
||||
content_frames = mel.shape[-1] - N_FRAMES
|
||||
content_duration = float(content_frames * HOP_LENGTH / SAMPLE_RATE)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user