Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ pipe = pipeline(
|
|
26 |
def transcribe(inputs, task):
|
27 |
if inputs is None:
|
28 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
29 |
-
text = pipe(inputs
|
30 |
return text
|
31 |
|
32 |
|
@@ -92,7 +92,7 @@ demo = gr.Blocks()
|
|
92 |
gradio_app = gr.Interface(
|
93 |
fn=transcribe,
|
94 |
inputs=[
|
95 |
-
gr.Audio(),
|
96 |
gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
|
97 |
],
|
98 |
outputs="text",
|
|
|
26 |
def transcribe(inputs, task):
|
27 |
if inputs is None:
|
28 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
29 |
+
text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task})["text"]
|
30 |
return text
|
31 |
|
32 |
|
|
|
92 |
gradio_app = gr.Interface(
|
93 |
fn=transcribe,
|
94 |
inputs=[
|
95 |
+
gr.Audio(type='filepath'),
|
96 |
gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
|
97 |
],
|
98 |
outputs="text",
|