Skip to content

Commit

Permalink
Transcribe on GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
take0x committed Sep 9, 2024
1 parent ba3f3cd commit 2448c6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2448c6f

Please sign in to comment.