Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
caf4011
1
Parent(s):
581b819
dont pass in model to decorated function, hopefully will fix pickle error
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ def convert_audio(audio_filepath, tmpdir, utt_id):
|
|
63 |
return out_filename, duration
|
64 |
|
65 |
@spaces.GPU
|
66 |
-
def transcribe(manifest_filepath,
|
67 |
"""
|
68 |
Transcribe audio using either model.transcribe or buffered inference.
|
69 |
Duration limit determines which method to use and what chunk size will
|
@@ -182,7 +182,7 @@ def on_go_btn_click(audio_filepath, src_lang, tgt_lang, pnc, gen_ts):
|
|
182 |
|
183 |
|
184 |
if gen_ts == "yes": # if will generate timestamps
|
185 |
-
output = transcribe(manifest_filepath,
|
186 |
|
187 |
# process output to get word and segment level timestamps
|
188 |
word_level_timestamps = output[0].timestamp["word"]
|
@@ -201,7 +201,7 @@ def on_go_btn_click(audio_filepath, src_lang, tgt_lang, pnc, gen_ts):
|
|
201 |
output_html += "</div>\n"
|
202 |
|
203 |
else: # if will not generate timestamps
|
204 |
-
output = transcribe(manifest_filepath,
|
205 |
|
206 |
if taskname == "asr":
|
207 |
output_html += "<div class='heading'>Transcript</div>\n"
|
|
|
63 |
return out_filename, duration
|
64 |
|
65 |
@spaces.GPU
|
66 |
+
def transcribe(manifest_filepath, audio_duration, duration_limit):
|
67 |
"""
|
68 |
Transcribe audio using either model.transcribe or buffered inference.
|
69 |
Duration limit determines which method to use and what chunk size will
|
|
|
182 |
|
183 |
|
184 |
if gen_ts == "yes": # if will generate timestamps
|
185 |
+
output = transcribe(manifest_filepath, audio_duration=duration, duration_limit=10.0)
|
186 |
|
187 |
# process output to get word and segment level timestamps
|
188 |
word_level_timestamps = output[0].timestamp["word"]
|
|
|
201 |
output_html += "</div>\n"
|
202 |
|
203 |
else: # if will not generate timestamps
|
204 |
+
output = transcribe(manifest_filepath, audio_duration=duration, duration_limit=40.0)
|
205 |
|
206 |
if taskname == "asr":
|
207 |
output_html += "<div class='heading'>Transcript</div>\n"
|