Commit
·
33d3f17
1
Parent(s):
fdb0230
return to gr.interface
Browse files
app.py
CHANGED
|
@@ -9,7 +9,6 @@ def main():
|
|
| 9 |
with gr.Tab("Video", id="video"):
|
| 10 |
with gr.Row():
|
| 11 |
with gr.Column():
|
| 12 |
-
video = True
|
| 13 |
file = gr.File(file_types=["video"],type="filepath", label="Upload a video")
|
| 14 |
file_type = gr.Radio(choices=["video"], value="video", label="File Type", visible=False)
|
| 15 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
|
@@ -22,16 +21,16 @@ def main():
|
|
| 22 |
text_output = gr.Textbox(label="SRT Text transcription")
|
| 23 |
srt_file = gr.File(value=None, file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
| 24 |
text_clean_output = gr.Textbox(label="Text transcription")
|
| 25 |
-
|
| 26 |
fn=transcriber,
|
| 27 |
inputs=[file, file_type, max_words_per_line, task, model_version],
|
| 28 |
-
outputs=[text_output, srt_file, text_clean_output]
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
with gr.Tab("Audio", id = "audio"):
|
| 32 |
with gr.Row():
|
| 33 |
with gr.Column():
|
| 34 |
-
video = False
|
| 35 |
file = gr.File(file_types=["audio"],type="filepath", label="Upload an audio file")
|
| 36 |
file_type = gr.Radio(choices=["audio"], value="audio", label="File Type", visible=False)
|
| 37 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
|
@@ -44,11 +43,12 @@ def main():
|
|
| 44 |
text_output = gr.Textbox(label="SRT Text transcription")
|
| 45 |
srt_file = gr.File(value=None, file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
| 46 |
text_clean_output = gr.Textbox(label="Text transcription")
|
| 47 |
-
|
| 48 |
fn=transcriber,
|
| 49 |
inputs=[file, file_type, max_words_per_line, task, model_version],
|
| 50 |
-
outputs=[text_output, srt_file, text_clean_output]
|
| 51 |
-
|
|
|
|
| 52 |
demo.launch()
|
| 53 |
|
| 54 |
if __name__ == '__main__':
|
|
|
|
| 9 |
with gr.Tab("Video", id="video"):
|
| 10 |
with gr.Row():
|
| 11 |
with gr.Column():
|
|
|
|
| 12 |
file = gr.File(file_types=["video"],type="filepath", label="Upload a video")
|
| 13 |
file_type = gr.Radio(choices=["video"], value="video", label="File Type", visible=False)
|
| 14 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
|
|
|
| 21 |
text_output = gr.Textbox(label="SRT Text transcription")
|
| 22 |
srt_file = gr.File(value=None, file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
| 23 |
text_clean_output = gr.Textbox(label="Text transcription")
|
| 24 |
+
gr.Interface(
|
| 25 |
fn=transcriber,
|
| 26 |
inputs=[file, file_type, max_words_per_line, task, model_version],
|
| 27 |
+
outputs=[text_output, srt_file, text_clean_output],
|
| 28 |
+
allow_flagging="never"
|
| 29 |
)
|
| 30 |
|
| 31 |
with gr.Tab("Audio", id = "audio"):
|
| 32 |
with gr.Row():
|
| 33 |
with gr.Column():
|
|
|
|
| 34 |
file = gr.File(file_types=["audio"],type="filepath", label="Upload an audio file")
|
| 35 |
file_type = gr.Radio(choices=["audio"], value="audio", label="File Type", visible=False)
|
| 36 |
max_words_per_line = gr.Number(value=6, label="Max words per line")
|
|
|
|
| 43 |
text_output = gr.Textbox(label="SRT Text transcription")
|
| 44 |
srt_file = gr.File(value=None, file_count="single", type="filepath", file_types=[".srt"], label="SRT file")
|
| 45 |
text_clean_output = gr.Textbox(label="Text transcription")
|
| 46 |
+
gr.Interface(
|
| 47 |
fn=transcriber,
|
| 48 |
inputs=[file, file_type, max_words_per_line, task, model_version],
|
| 49 |
+
outputs=[text_output, srt_file, text_clean_output],
|
| 50 |
+
allow_flagging="never"
|
| 51 |
+
)
|
| 52 |
demo.launch()
|
| 53 |
|
| 54 |
if __name__ == '__main__':
|