msis commited on
Commit
113d436
1 Parent(s): 7bf4d2e

reduce verbosity of nemo and print output

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -40,13 +40,15 @@ model = nemo_asr.models.EncDecCTCModelBPE.restore_from(
40
 
41
 
42
  def transcribe(audio_file):
43
- transcription_file = model.transcribe([audio_file])[0]
44
- return transcription_file
 
45
 
46
 
47
  def get_duration_ms(audio_file):
48
  duration = mediainfo(audio_file)["duration"] # a string in seconds
49
  duration_ms = int(float(duration) * 1000)
 
50
  return duration_ms
51
 
52
 
 
40
 
41
 
42
  def transcribe(audio_file):
43
+ transcription = model.transcribe([audio_file], verbose=False)[0]
44
+ print(f"{audio_file}: {transcription}")
45
+ return transcription
46
 
47
 
48
  def get_duration_ms(audio_file):
49
  duration = mediainfo(audio_file)["duration"] # a string in seconds
50
  duration_ms = int(float(duration) * 1000)
51
+ print(f"{audio_file}: {duration_ms} ms")
52
  return duration_ms
53
 
54