marquesafonso
commited on
Commit
·
3710621
1
Parent(s):
305b768
set static paths to include srt file
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ from src.transcriber import transcriber
|
|
3 |
|
4 |
def main():
|
5 |
with gr.Blocks(analytics_enabled=False, title='multilang-asr-transcriber') as demo:
|
6 |
-
gr.set_static_paths(paths=["/tmp/gradio/"])
|
7 |
gr.Markdown('# multilang-asr-transcriber')
|
8 |
gr.Markdown('### A multilingual automatic speech transcription tool using [faster-whisper](https://github.com/SYSTRAN/faster-whisper). Supports translation to english and user setting of max words per line.')
|
9 |
video_file = gr.File(file_types=["video"],type="filepath", label="Upload a video")
|
@@ -11,12 +10,13 @@ def main():
|
|
11 |
task = gr.Dropdown(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
|
12 |
text_output = gr.Textbox(label="Text transcription")
|
13 |
srt_file = gr.File(file_count="single", file_types=[".srt"], label="SRT file")
|
|
|
14 |
gr.Interface(transcriber,
|
15 |
inputs=[video_file, max_words_per_line, task],
|
16 |
outputs=[text_output,srt_file],
|
17 |
allow_flagging="never",
|
18 |
analytics_enabled=False)
|
19 |
-
demo.launch()
|
20 |
|
21 |
if __name__ == '__main__':
|
22 |
main()
|
|
|
3 |
|
4 |
def main():
|
5 |
with gr.Blocks(analytics_enabled=False, title='multilang-asr-transcriber') as demo:
|
|
|
6 |
gr.Markdown('# multilang-asr-transcriber')
|
7 |
gr.Markdown('### A multilingual automatic speech transcription tool using [faster-whisper](https://github.com/SYSTRAN/faster-whisper). Supports translation to english and user setting of max words per line.')
|
8 |
video_file = gr.File(file_types=["video"],type="filepath", label="Upload a video")
|
|
|
10 |
task = gr.Dropdown(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
|
11 |
text_output = gr.Textbox(label="Text transcription")
|
12 |
srt_file = gr.File(file_count="single", file_types=[".srt"], label="SRT file")
|
13 |
+
gr.set_static_paths(paths=[srt_file])
|
14 |
gr.Interface(transcriber,
|
15 |
inputs=[video_file, max_words_per_line, task],
|
16 |
outputs=[text_output,srt_file],
|
17 |
allow_flagging="never",
|
18 |
analytics_enabled=False)
|
19 |
+
demo.launch(allowed_paths=[srt_file])
|
20 |
|
21 |
if __name__ == '__main__':
|
22 |
main()
|