Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,18 @@ def launch(input):
|
|
12 |
out2 = pipe2(out)
|
13 |
return out2[0]['summarized notes']
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
mic_transcribe = gr.Interface(
|
16 |
fn=transcribe_long_form,
|
17 |
inputs=gr.Audio(sources="microphone",
|
|
|
12 |
out2 = pipe2(out)
|
13 |
return out2[0]['summarized notes']
|
14 |
|
15 |
+
def transcribe_long_form(filepath):
|
16 |
+
if filepath is None:
|
17 |
+
gr.Warning("No audio found, please retry.")
|
18 |
+
return ""
|
19 |
+
output = asr(
|
20 |
+
filepath,
|
21 |
+
max_new_tokens=256,
|
22 |
+
chunk_length_s=30,
|
23 |
+
batch_size=8,
|
24 |
+
)
|
25 |
+
return output["text"]
|
26 |
+
|
27 |
mic_transcribe = gr.Interface(
|
28 |
fn=transcribe_long_form,
|
29 |
inputs=gr.Audio(sources="microphone",
|