Spaces:
Build error
Build error
reduce verbosity of nemo and print output
Browse files
app.py
CHANGED
@@ -40,13 +40,15 @@ model = nemo_asr.models.EncDecCTCModelBPE.restore_from(
|
|
40 |
|
41 |
|
42 |
def transcribe(audio_file):
|
43 |
-
|
44 |
-
|
|
|
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 |
|