textToSQL commited on
Commit
e8a1049
·
1 Parent(s): c9fdada

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -22,7 +22,7 @@ def transcribe(audio):
22
 
23
  #time.sleep(3)
24
  # load audio and pad/trim it to fit 30 seconds
25
- audio = whisper.load_audio(audio)
26
  audio = whisper.pad_or_trim(audio)
27
 
28
  # make log-Mel spectrogram and move to the same device as the model
@@ -33,7 +33,7 @@ def transcribe(audio):
33
  print(f"Detected language: {max(probs, key=probs.get)}")
34
 
35
  # decode the audio
36
- options = whisper.DecodingOptions(fp16 = True)
37
  result = whisper.decode(model, mel, options)
38
  return result.text
39
 
 
22
 
23
  #time.sleep(3)
24
  # load audio and pad/trim it to fit 30 seconds
25
+ audio = whisper.load_audio(audio_file)
26
  audio = whisper.pad_or_trim(audio)
27
 
28
  # make log-Mel spectrogram and move to the same device as the model
 
33
  print(f"Detected language: {max(probs, key=probs.get)}")
34
 
35
  # decode the audio
36
+ options = whisper.DecodingOptions(fp16 = False)
37
  result = whisper.decode(model, mel, options)
38
  return result.text
39