add file_type as radio
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ def main():
|
|
9 |
with gr.Tab("Video"):
|
10 |
video = True
|
11 |
file = gr.File(file_types=["video"],type="filepath", label="Upload a video")
|
|
|
12 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
13 |
task = gr.Radio(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
|
14 |
model_version = gr.Radio(choices=["deepdml/faster-whisper-large-v3-turbo-ct2", "large-v3"], value="deepdml/faster-whisper-large-v3-turbo-ct2", label="Select Model")
|
@@ -16,13 +17,14 @@ def main():
|
|
16 |
srt_file = gr.File(file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
17 |
text_clean_output = gr.Textbox(label="Text transcription", show_copy_button=True)
|
18 |
gr.Interface(transcriber,
|
19 |
-
inputs=[file,
|
20 |
outputs=[text_output, srt_file, text_clean_output],
|
21 |
allow_flagging="never")
|
22 |
|
23 |
with gr.Tab("Audio"):
|
24 |
video = False
|
25 |
file = gr.File(file_types=["audio"],type="filepath", label="Upload an audio file")
|
|
|
26 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
27 |
task = gr.Radio(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
|
28 |
model_version = gr.Radio(choices=["deepdml/faster-whisper-large-v3-turbo-ct2", "large-v3"], value="deepdml/faster-whisper-large-v3-turbo-ct2", label="Select Model")
|
@@ -30,7 +32,7 @@ def main():
|
|
30 |
srt_file = gr.File(file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
31 |
text_clean_output = gr.Textbox(label="Text transcription", show_copy_button=True)
|
32 |
gr.Interface(transcriber,
|
33 |
-
inputs=[file,
|
34 |
outputs=[text_output, srt_file, text_clean_output],
|
35 |
allow_flagging="never")
|
36 |
demo.launch()
|
|
|
9 |
with gr.Tab("Video"):
|
10 |
video = True
|
11 |
file = gr.File(file_types=["video"],type="filepath", label="Upload a video")
|
12 |
+
file_type = gr.Radio(choices=["video"], value="video", label="File Type")
|
13 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
14 |
task = gr.Radio(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
|
15 |
model_version = gr.Radio(choices=["deepdml/faster-whisper-large-v3-turbo-ct2", "large-v3"], value="deepdml/faster-whisper-large-v3-turbo-ct2", label="Select Model")
|
|
|
17 |
srt_file = gr.File(file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
18 |
text_clean_output = gr.Textbox(label="Text transcription", show_copy_button=True)
|
19 |
gr.Interface(transcriber,
|
20 |
+
inputs=[file, file_type, max_words_per_line, task, model_version],
|
21 |
outputs=[text_output, srt_file, text_clean_output],
|
22 |
allow_flagging="never")
|
23 |
|
24 |
with gr.Tab("Audio"):
|
25 |
video = False
|
26 |
file = gr.File(file_types=["audio"],type="filepath", label="Upload an audio file")
|
27 |
+
file_type = gr.Radio(choices=["audio"], value="audio", label="File Type")
|
28 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
29 |
task = gr.Radio(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
|
30 |
model_version = gr.Radio(choices=["deepdml/faster-whisper-large-v3-turbo-ct2", "large-v3"], value="deepdml/faster-whisper-large-v3-turbo-ct2", label="Select Model")
|
|
|
32 |
srt_file = gr.File(file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
33 |
text_clean_output = gr.Textbox(label="Text transcription", show_copy_button=True)
|
34 |
gr.Interface(transcriber,
|
35 |
+
inputs=[file, file_type, max_words_per_line, task, model_version],
|
36 |
outputs=[text_output, srt_file, text_clean_output],
|
37 |
allow_flagging="never")
|
38 |
demo.launch()
|