marquesafonso commited on
Commit
305b768
·
1 Parent(s): 4697cf0

set static paths to include temp dir

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -3,9 +3,10 @@ from src.transcriber import transcriber
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")
9
  max_words_per_line = gr.Number(value=6, label="Max words per line")
10
  task = gr.Dropdown(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
11
  text_output = gr.Textbox(label="Text transcription")
@@ -15,7 +16,7 @@ def main():
15
  outputs=[text_output,srt_file],
16
  allow_flagging="never",
17
  analytics_enabled=False)
18
- demo.launch(allowed_paths=["https://marquesafonso-multilang-asr-transcriber.hf.space/file=/tmp/gradio/"])
19
 
20
  if __name__ == '__main__':
21
  main()
 
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")
10
  max_words_per_line = gr.Number(value=6, label="Max words per line")
11
  task = gr.Dropdown(choices=["transcribe", "translate"], value="transcribe", label="Select Task")
12
  text_output = gr.Textbox(label="Text transcription")
 
16
  outputs=[text_output,srt_file],
17
  allow_flagging="never",
18
  analytics_enabled=False)
19
+ demo.launch()
20
 
21
  if __name__ == '__main__':
22
  main()