Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,7 +123,7 @@ def transcribe(url):
|
|
| 123 |
wordlevel_info=word_level_transcribe(mp3_file)
|
| 124 |
subtitles = create_subtitles(wordlevel_info)
|
| 125 |
subtitle_file = generate_subtitle_file('fa', subtitles, 'video_subtitled')
|
| 126 |
-
return subtitle_file, video
|
| 127 |
|
| 128 |
with gr.Blocks() as demo:
|
| 129 |
gr.Markdown("Start typing below and then click **Run** to see the progress and final output.")
|
|
@@ -133,10 +133,11 @@ with gr.Blocks() as demo:
|
|
| 133 |
srt_file = gr.File()
|
| 134 |
btn = gr.Button("Create")
|
| 135 |
video_file_output = gr.Video(label="Result Video")
|
|
|
|
| 136 |
btn.click(
|
| 137 |
fn=transcribe,
|
| 138 |
inputs=url,
|
| 139 |
-
outputs=[srt_file, video_file_output],
|
| 140 |
)
|
| 141 |
|
| 142 |
demo.launch(debug=True)
|
|
|
|
| 123 |
wordlevel_info=word_level_transcribe(mp3_file)
|
| 124 |
subtitles = create_subtitles(wordlevel_info)
|
| 125 |
subtitle_file = generate_subtitle_file('fa', subtitles, 'video_subtitled')
|
| 126 |
+
return subtitle_file, video, mp3_file
|
| 127 |
|
| 128 |
with gr.Blocks() as demo:
|
| 129 |
gr.Markdown("Start typing below and then click **Run** to see the progress and final output.")
|
|
|
|
| 133 |
srt_file = gr.File()
|
| 134 |
btn = gr.Button("Create")
|
| 135 |
video_file_output = gr.Video(label="Result Video")
|
| 136 |
+
mp3_file = gr.Audio(type="file_path")
|
| 137 |
btn.click(
|
| 138 |
fn=transcribe,
|
| 139 |
inputs=url,
|
| 140 |
+
outputs=[srt_file, video_file_output, mp3_file],
|
| 141 |
)
|
| 142 |
|
| 143 |
demo.launch(debug=True)
|