Update app.py
Browse files
app.py
CHANGED
@@ -110,8 +110,8 @@ 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 |
-
|
115 |
|
116 |
with gr.Accordion("Speaker diarization", open=False, visible=True):
|
117 |
cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Use diarization",interactive=True)
|
@@ -261,11 +261,11 @@ class App:
|
|
261 |
uvr_save_file=cb_uvr_save_file, uvr_enable_offload=cb_uvr_enable_offload
|
262 |
),
|
263 |
dd_file_format,
|
264 |
-
|
265 |
cb_translate_output,
|
266 |
dd_translate_model,
|
267 |
dd_target_lang,
|
268 |
-
|
269 |
)
|
270 |
|
271 |
def launch(self):
|
@@ -290,7 +290,7 @@ class App:
|
|
290 |
visible=self.args.colab,
|
291 |
value="")
|
292 |
|
293 |
-
whisper_params, dd_file_format,
|
294 |
|
295 |
with gr.Row():
|
296 |
btn_run = gr.Button("Transcribe", variant="primary")
|
@@ -304,7 +304,7 @@ class App:
|
|
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,
|
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])
|
|
|
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_timestamp_preview = gr.Checkbox(value=whisper_params["add_timestamp_preview"],label="Add timestamp to output preview", interactive=True)
|
114 |
+
cb_timestamp_file = gr.Checkbox(value=whisper_params["add_timestamp_file"], label="Add timestamp to output data", interactive=True)
|
115 |
|
116 |
with gr.Accordion("Speaker diarization", open=False, visible=True):
|
117 |
cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Use diarization",interactive=True)
|
|
|
261 |
uvr_save_file=cb_uvr_save_file, uvr_enable_offload=cb_uvr_enable_offload
|
262 |
),
|
263 |
dd_file_format,
|
264 |
+
cb_timestamp_file,
|
265 |
cb_translate_output,
|
266 |
dd_translate_model,
|
267 |
dd_target_lang,
|
268 |
+
cb_timestamp_preview
|
269 |
)
|
270 |
|
271 |
def launch(self):
|
|
|
290 |
visible=self.args.colab,
|
291 |
value="")
|
292 |
|
293 |
+
whisper_params, dd_file_format, cb_timestamp_file, cb_translate_output, dd_translate_model, dd_target_lang, cb_timestamp_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_file, cb_translate_output, dd_translate_model, dd_target_lang, cb_timestamp_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])
|