huedaya commited on
Commit
23a9064
·
1 Parent(s): b5f4a75
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -43,8 +43,8 @@ def runApi():
43
 
44
  audio = "audio.mp3"
45
 
46
- audio = whisper.load_audio(audio)
47
- audio = whisper.pad_or_trim(audio)
48
 
49
  mel = whisper.log_mel_spectrogram(audio).to(model.device)
50
 
@@ -54,9 +54,9 @@ def runApi():
54
  result = whisper.decode(model, mel, options)
55
 
56
  # test 2
57
- ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
58
- sample = ds[0]["audio"]
59
- prediction = pipe(sample.copy())["text"]
60
  print(prediction)
61
 
62
  end_time = time.time()
 
43
 
44
  audio = "audio.mp3"
45
 
46
+ audioOri = whisper.load_audio(audio)
47
+ audio = whisper.pad_or_trim(audioOri)
48
 
49
  mel = whisper.log_mel_spectrogram(audio).to(model.device)
50
 
 
54
  result = whisper.decode(model, mel, options)
55
 
56
  # test 2
57
+ # ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
58
+ # sample = ds[0]["audio"]
59
+ prediction = pipe(audioOri)["text"]
60
  print(prediction)
61
 
62
  end_time = time.time()