only allow for (english) transcription as task
Browse files
app.py
CHANGED
@@ -38,14 +38,10 @@ def format_timestamp(
|
|
38 |
return seconds
|
39 |
|
40 |
|
41 |
-
def transcribe(file,
|
42 |
outputs = pipe(
|
43 |
file,
|
44 |
batch_size=BATCH_SIZE,
|
45 |
-
generate_kwargs={
|
46 |
-
"task": task,
|
47 |
-
"language": "english",
|
48 |
-
},
|
49 |
return_timestamps=return_timestamps,
|
50 |
)
|
51 |
text = outputs["text"]
|
@@ -63,7 +59,6 @@ demo = gr.Interface(
|
|
63 |
fn=transcribe,
|
64 |
inputs=[
|
65 |
gr.Audio(label="Audio", type="filepath"),
|
66 |
-
gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
|
67 |
gr.Checkbox(label="Return timestamps"),
|
68 |
],
|
69 |
outputs=gr.Textbox(show_copy_button=True, label="Text"),
|
|
|
38 |
return seconds
|
39 |
|
40 |
|
41 |
+
def transcribe(file, return_timestamps):
|
42 |
outputs = pipe(
|
43 |
file,
|
44 |
batch_size=BATCH_SIZE,
|
|
|
|
|
|
|
|
|
45 |
return_timestamps=return_timestamps,
|
46 |
)
|
47 |
text = outputs["text"]
|
|
|
59 |
fn=transcribe,
|
60 |
inputs=[
|
61 |
gr.Audio(label="Audio", type="filepath"),
|
|
|
62 |
gr.Checkbox(label="Return timestamps"),
|
63 |
],
|
64 |
outputs=gr.Textbox(show_copy_button=True, label="Text"),
|