Spaces:
Running
Running
jhj0517
commited on
Commit
Β·
2514ff4
1
Parent(s):
ea1ae52
add debug function
Browse files
app.py
CHANGED
@@ -78,6 +78,9 @@ class App:
|
|
78 |
else:
|
79 |
return gr.Checkbox(visible=True, value=False, label="Translate to English?", interactive=True)
|
80 |
|
|
|
|
|
|
|
81 |
def launch(self):
|
82 |
with self.app:
|
83 |
with gr.Row():
|
@@ -158,9 +161,10 @@ class App:
|
|
158 |
hf_token=tb_hf_token,
|
159 |
diarization_device=dd_diarization_device)
|
160 |
|
161 |
-
btn_run.click(fn=self.whisper_inf.transcribe_file,
|
162 |
-
|
163 |
-
|
|
|
164 |
dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
|
165 |
|
166 |
with gr.TabItem("Youtube"): # tab2
|
@@ -354,17 +358,12 @@ class App:
|
|
354 |
with gr.Row():
|
355 |
tb_indicator = gr.Textbox(label="Output", scale=5)
|
356 |
files_subtitles = gr.Files(label="Downloadable output file", scale=3)
|
357 |
-
btn_openfolder = gr.Button('π', scale=1)
|
358 |
|
359 |
btn_run.click(fn=self.deepl_api.translate_deepl,
|
360 |
inputs=[tb_authkey, file_subs, dd_deepl_sourcelang, dd_deepl_targetlang,
|
361 |
cb_deepl_ispro],
|
362 |
outputs=[tb_indicator, files_subtitles])
|
363 |
|
364 |
-
btn_openfolder.click(fn=lambda: self.open_folder(os.path.join("outputs", "translations")),
|
365 |
-
inputs=None,
|
366 |
-
outputs=None)
|
367 |
-
|
368 |
with gr.TabItem("NLLB"): # sub tab2
|
369 |
with gr.Row():
|
370 |
dd_nllb_model = gr.Dropdown(label="Model", value="facebook/nllb-200-1.3B",
|
@@ -381,7 +380,6 @@ class App:
|
|
381 |
with gr.Row():
|
382 |
tb_indicator = gr.Textbox(label="Output", scale=5)
|
383 |
files_subtitles = gr.Files(label="Downloadable output file", scale=3)
|
384 |
-
btn_openfolder = gr.Button('π', scale=1)
|
385 |
with gr.Column():
|
386 |
md_vram_table = gr.HTML(NLLB_VRAM_TABLE, elem_id="md_nllb_vram_table")
|
387 |
|
@@ -389,10 +387,6 @@ class App:
|
|
389 |
inputs=[file_subs, dd_nllb_model, dd_nllb_sourcelang, dd_nllb_targetlang, cb_timestamp],
|
390 |
outputs=[tb_indicator, files_subtitles])
|
391 |
|
392 |
-
btn_openfolder.click(fn=lambda: self.open_folder(os.path.join("outputs", "translations")),
|
393 |
-
inputs=None,
|
394 |
-
outputs=None)
|
395 |
-
|
396 |
# Launch the app with optional gradio settings
|
397 |
launch_args = {}
|
398 |
if self.args.share:
|
|
|
78 |
else:
|
79 |
return gr.Checkbox(visible=True, value=False, label="Translate to English?", interactive=True)
|
80 |
|
81 |
+
def test(self):
|
82 |
+
print("\nWHAT HAPPEND?\n")
|
83 |
+
|
84 |
def launch(self):
|
85 |
with self.app:
|
86 |
with gr.Row():
|
|
|
161 |
hf_token=tb_hf_token,
|
162 |
diarization_device=dd_diarization_device)
|
163 |
|
164 |
+
# btn_run.click(fn=self.whisper_inf.transcribe_file,
|
165 |
+
# inputs=params + whisper_params.as_list(),
|
166 |
+
# outputs=[tb_indicator, files_subtitles])
|
167 |
+
btn_run.click(fn=self.test, inputs=None, outputs=None)
|
168 |
dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
|
169 |
|
170 |
with gr.TabItem("Youtube"): # tab2
|
|
|
358 |
with gr.Row():
|
359 |
tb_indicator = gr.Textbox(label="Output", scale=5)
|
360 |
files_subtitles = gr.Files(label="Downloadable output file", scale=3)
|
|
|
361 |
|
362 |
btn_run.click(fn=self.deepl_api.translate_deepl,
|
363 |
inputs=[tb_authkey, file_subs, dd_deepl_sourcelang, dd_deepl_targetlang,
|
364 |
cb_deepl_ispro],
|
365 |
outputs=[tb_indicator, files_subtitles])
|
366 |
|
|
|
|
|
|
|
|
|
367 |
with gr.TabItem("NLLB"): # sub tab2
|
368 |
with gr.Row():
|
369 |
dd_nllb_model = gr.Dropdown(label="Model", value="facebook/nllb-200-1.3B",
|
|
|
380 |
with gr.Row():
|
381 |
tb_indicator = gr.Textbox(label="Output", scale=5)
|
382 |
files_subtitles = gr.Files(label="Downloadable output file", scale=3)
|
|
|
383 |
with gr.Column():
|
384 |
md_vram_table = gr.HTML(NLLB_VRAM_TABLE, elem_id="md_nllb_vram_table")
|
385 |
|
|
|
387 |
inputs=[file_subs, dd_nllb_model, dd_nllb_sourcelang, dd_nllb_targetlang, cb_timestamp],
|
388 |
outputs=[tb_indicator, files_subtitles])
|
389 |
|
|
|
|
|
|
|
|
|
390 |
# Launch the app with optional gradio settings
|
391 |
launch_args = {}
|
392 |
if self.args.share:
|