Kevin676 commited on
Commit
a17c2a0
1 Parent(s): 17c17c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -102,16 +102,16 @@ def evaluate(
102
  audio = whisper.load_audio(audio)
103
  audio = whisper.pad_or_trim(audio)
104
 
105
- # make log-Mel spectrogram and move to the same device as the model
106
- mel = whisper.log_mel_spectrogram(audio).to(model.device)
107
 
108
  # detect the spoken language
109
- _, probs = model.detect_language(mel)
110
  print(f"Detected language: {max(probs, key=probs.get)}")
111
 
112
  # decode the audio
113
  options = whisper.DecodingOptions()
114
- result = whisper.decode(model, mel, options)
115
 
116
  instruction = result.text
117
 
 
102
  audio = whisper.load_audio(audio)
103
  audio = whisper.pad_or_trim(audio)
104
 
105
+ # make log-Mel spectrogram and move to the same device as the model1
106
+ mel = whisper.log_mel_spectrogram(audio).to(model1.device)
107
 
108
  # detect the spoken language
109
+ _, probs = model1.detect_language(mel)
110
  print(f"Detected language: {max(probs, key=probs.get)}")
111
 
112
  # decode the audio
113
  options = whisper.DecodingOptions()
114
+ result = whisper.decode(model1, mel, options)
115
 
116
  instruction = result.text
117