Update app.py
Browse files
app.py
CHANGED
@@ -110,8 +110,7 @@ class App:
|
|
110 |
cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate to selected language", info="Translate using Facebook's NLLB",interactive=True)
|
111 |
with gr.Row():
|
112 |
dd_file_format = gr.Dropdown(choices=["TXT","SRT"], value="TXT", label="Output format", interactive=True,visible=False)
|
113 |
-
|
114 |
-
with gr.Row():
|
115 |
cb_timestamp = gr.Checkbox(value=whisper_params["add_timestamp"], label="Add timestamp to output data",interactive=True)
|
116 |
|
117 |
with gr.Accordion("Speaker diarization", open=False, visible=True):
|
@@ -266,7 +265,7 @@ class App:
|
|
266 |
cb_translate_output,
|
267 |
dd_translate_model,
|
268 |
dd_target_lang,
|
269 |
-
|
270 |
)
|
271 |
|
272 |
def launch(self):
|
@@ -291,7 +290,7 @@ class App:
|
|
291 |
visible=self.args.colab,
|
292 |
value="")
|
293 |
|
294 |
-
whisper_params, dd_file_format, cb_timestamp, cb_translate_output, dd_translate_model, dd_target_lang,
|
295 |
|
296 |
with gr.Row():
|
297 |
btn_run = gr.Button("Transcribe", variant="primary")
|
@@ -305,7 +304,7 @@ class App:
|
|
305 |
files_subtitles = gr.Files(label="Output data", interactive=False, file_count="multiple")
|
306 |
# btn_openfolder = gr.Button('📂', scale=1)
|
307 |
|
308 |
-
params = [input_file, tb_input_folder, dd_file_format, cb_timestamp, cb_translate_output, dd_translate_model, dd_target_lang,
|
309 |
btn_run.click(fn=self.whisper_inf.transcribe_file,
|
310 |
inputs=params + whisper_params.as_list(),
|
311 |
outputs=[tb_indicator, files_subtitles, tb_info])
|
|
|
110 |
cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate to selected language", info="Translate using Facebook's NLLB",interactive=True)
|
111 |
with gr.Row():
|
112 |
dd_file_format = gr.Dropdown(choices=["TXT","SRT"], value="TXT", label="Output format", interactive=True,visible=False)
|
113 |
+
cb_preview = gr.Checkbox(value=True,label="Add timestamp to output preview", interactive=True)
|
|
|
114 |
cb_timestamp = gr.Checkbox(value=whisper_params["add_timestamp"], label="Add timestamp to output data",interactive=True)
|
115 |
|
116 |
with gr.Accordion("Speaker diarization", open=False, visible=True):
|
|
|
265 |
cb_translate_output,
|
266 |
dd_translate_model,
|
267 |
dd_target_lang,
|
268 |
+
cb_preview
|
269 |
)
|
270 |
|
271 |
def launch(self):
|
|
|
290 |
visible=self.args.colab,
|
291 |
value="")
|
292 |
|
293 |
+
whisper_params, dd_file_format, cb_timestamp, cb_translate_output, dd_translate_model, dd_target_lang, cb_preview = self.create_whisper_parameters()
|
294 |
|
295 |
with gr.Row():
|
296 |
btn_run = gr.Button("Transcribe", variant="primary")
|
|
|
304 |
files_subtitles = gr.Files(label="Output data", interactive=False, file_count="multiple")
|
305 |
# btn_openfolder = gr.Button('📂', scale=1)
|
306 |
|
307 |
+
params = [input_file, tb_input_folder, dd_file_format, cb_timestamp, cb_translate_output, dd_translate_model, dd_target_lang, cb_preview]
|
308 |
btn_run.click(fn=self.whisper_inf.transcribe_file,
|
309 |
inputs=params + whisper_params.as_list(),
|
310 |
outputs=[tb_indicator, files_subtitles, tb_info])
|