jeonsworld commited on
Commit
c071c50
1 Parent(s): 067600f

first commit

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -8,15 +8,14 @@ model = whisper.load_model("medium")
8
 
9
  def inference(audio):
10
  audio = whisper.load_audio(audio)
11
-
12
  audio = whisper.pad_or_trim(audio)
13
 
14
  mel = whisper.log_mel_spectrogram(audio).to(model.device)
15
 
16
  # _, probs = model.detect_language(mel)
17
- options = dict(language="Korean", beam_size=5, best_of=5)
18
- options = whisper.DecodingOptions(fp16=False, task="transcribe", **options)
19
- result = whisper.decode(model, mel, options)
20
  # print(result.text)
21
  return result.text
22
 
 
8
 
9
  def inference(audio):
10
  audio = whisper.load_audio(audio)
 
11
  audio = whisper.pad_or_trim(audio)
12
 
13
  mel = whisper.log_mel_spectrogram(audio).to(model.device)
14
 
15
  # _, probs = model.detect_language(mel)
16
+ options = dict(language="Korean", beam_size=5)
17
+ transcribe_options = whisper.DecodingOptions(fp16=False, task="transcribe", **options)
18
+ result = whisper.decode(model, mel, transcribe_options)
19
  # print(result.text)
20
  return result.text
21