Skip to content

Commit

Permalink
remove unnecessary warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzilin committed Sep 30, 2022
1 parent 287eb41 commit d0c9160
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,8 @@ def transcribe(
A dictionary containing the resulting text ("text") and segment-level details ("segments"), and
the spoken language ("language"), which is detected when `decode_options["language"]` is None.
"""
dtype = torch.float16 if decode_options.get("fp16", True) else torch.float32
if model.device == torch.device("cpu"):
if torch.cuda.is_available():
warnings.warn("Performing inference on CPU when CUDA is available")
if dtype == torch.float16:
warnings.warn("FP16 is not supported on CPU; using FP32 instead")
dtype = torch.float32

if dtype == torch.float32:
decode_options["fp16"] = False
dtype = torch.float32
decode_options["fp16"] = False

mel = log_mel_spectrogram(audio)

Expand Down

0 comments on commit d0c9160

Please sign in to comment.