Update app.py
Browse files
app.py
CHANGED
@@ -97,33 +97,35 @@ class App:
|
|
97 |
|
98 |
with gr.Row():
|
99 |
with gr.Column(scale=1):
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
102 |
with gr.Column(scale=4):
|
103 |
input_file_audio = gr.Audio(type='filepath', elem_id="audio_input", show_download_button=True, visible=True, interactive=True)
|
104 |
input_file_video = gr.Video(elem_id="video_input", show_download_button=True, visible=False, interactive=True)
|
105 |
input_file_multi = gr.Files(label="Upload one or more audio/video files here", elem_id="multi_input", type='filepath', file_count="multiple", allow_reordering=True, file_types=["audio","video"], visible=False, interactive=True)
|
106 |
|
107 |
with gr.Row():
|
108 |
-
with gr.Column(scale=
|
109 |
with gr.Row():
|
110 |
model_list = self.whisper_inf.available_models if len(whisper_params["model_list"]) == 0 else whisper_params["model_list"]
|
111 |
dd_model = gr.Dropdown(choices=model_list, value=whisper_params["model_size"],label="Model", info="Larger models increase transcription quality, but reduce performance", interactive=True)
|
112 |
-
dd_lang = gr.Dropdown(choices=["Automatic Detection"] + self.whisper_inf.available_langs,value=whisper_params["lang"], label="Language", info="
|
113 |
with gr.Row():
|
114 |
dd_translate_model = gr.Dropdown(choices=self.nllb_inf.available_models, value=nllb_params["model_size"],label="Model", info="Model used for translation", interactive=True)
|
115 |
dd_target_lang = gr.Dropdown(choices=["English","Dutch","French","German"], value=nllb_params["target_lang"],label="Language", info="Language used for output translation", interactive=True)
|
116 |
-
with gr.Column(scale=
|
117 |
with gr.Row():
|
118 |
cb_timestamp_preview = gr.Checkbox(value=whisper_params["add_timestamp_preview"],label="Add timestamp to preview", interactive=True)
|
119 |
-
cb_timestamp_file = gr.Checkbox(value=whisper_params["add_timestamp_file"], label="Add timestamp to output", interactive=True)
|
120 |
with gr.Row():
|
121 |
cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Speaker diarization", info="Token required for diarization",interactive=True)
|
122 |
with gr.Row():
|
123 |
cb_translate = gr.Checkbox(value=whisper_params["is_translate"], label="Translate to English", info="Translate using OpenAI Whisper's built-in module",interactive=True)
|
124 |
cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate to selected language", info="Translate using Facebook's NLLB",interactive=True)
|
125 |
|
126 |
-
with gr.Accordion("Options", open=False, visible=True):
|
127 |
|
128 |
with gr.Accordion("Diarization", open=False, visible=True):
|
129 |
tb_hf_token = gr.Text(label="Token", value=diarization_params["hf_token"],info="An access token is required to use diarization & can be created [here](https://hf.co/settings/tokens). If not done yet for your account, you need to accept the terms & conditions of [diarization](https://huggingface.co/pyannote/speaker-diarization-3.1) & [segmentation](https://huggingface.co/pyannote/segmentation-3.0).")
|
|
|
97 |
|
98 |
with gr.Row():
|
99 |
with gr.Column(scale=1):
|
100 |
+
with gr.Row():
|
101 |
+
input_multi = gr.Radio(["Audio", "Video", "Multiple"], label="Process one or multiple files", value="Audio")
|
102 |
+
with gr.Row():
|
103 |
+
dd_file_format = gr.Dropdown(choices=["CSV","SRT","TXT"], value=whisper_params["output_format"], label="Output format", multiselect=True, interactive=True, visible=True)
|
104 |
+
cb_timestamp_file = gr.Checkbox(value=whisper_params["add_timestamp_file"], label="Add timestamp to output", interactive=True)
|
105 |
with gr.Column(scale=4):
|
106 |
input_file_audio = gr.Audio(type='filepath', elem_id="audio_input", show_download_button=True, visible=True, interactive=True)
|
107 |
input_file_video = gr.Video(elem_id="video_input", show_download_button=True, visible=False, interactive=True)
|
108 |
input_file_multi = gr.Files(label="Upload one or more audio/video files here", elem_id="multi_input", type='filepath', file_count="multiple", allow_reordering=True, file_types=["audio","video"], visible=False, interactive=True)
|
109 |
|
110 |
with gr.Row():
|
111 |
+
with gr.Column(scale=4):
|
112 |
with gr.Row():
|
113 |
model_list = self.whisper_inf.available_models if len(whisper_params["model_list"]) == 0 else whisper_params["model_list"]
|
114 |
dd_model = gr.Dropdown(choices=model_list, value=whisper_params["model_size"],label="Model", info="Larger models increase transcription quality, but reduce performance", interactive=True)
|
115 |
+
dd_lang = gr.Dropdown(choices=["Automatic Detection"] + self.whisper_inf.available_langs,value=whisper_params["lang"], label="Language", info="If the language is known upfront, always set it manually", interactive=True)
|
116 |
with gr.Row():
|
117 |
dd_translate_model = gr.Dropdown(choices=self.nllb_inf.available_models, value=nllb_params["model_size"],label="Model", info="Model used for translation", interactive=True)
|
118 |
dd_target_lang = gr.Dropdown(choices=["English","Dutch","French","German"], value=nllb_params["target_lang"],label="Language", info="Language used for output translation", interactive=True)
|
119 |
+
with gr.Column(scale=1):
|
120 |
with gr.Row():
|
121 |
cb_timestamp_preview = gr.Checkbox(value=whisper_params["add_timestamp_preview"],label="Add timestamp to preview", interactive=True)
|
|
|
122 |
with gr.Row():
|
123 |
cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Speaker diarization", info="Token required for diarization",interactive=True)
|
124 |
with gr.Row():
|
125 |
cb_translate = gr.Checkbox(value=whisper_params["is_translate"], label="Translate to English", info="Translate using OpenAI Whisper's built-in module",interactive=True)
|
126 |
cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate to selected language", info="Translate using Facebook's NLLB",interactive=True)
|
127 |
|
128 |
+
with gr.Accordion("Options & advanced preprocessing filters", open=False, visible=True):
|
129 |
|
130 |
with gr.Accordion("Diarization", open=False, visible=True):
|
131 |
tb_hf_token = gr.Text(label="Token", value=diarization_params["hf_token"],info="An access token is required to use diarization & can be created [here](https://hf.co/settings/tokens). If not done yet for your account, you need to accept the terms & conditions of [diarization](https://huggingface.co/pyannote/speaker-diarization-3.1) & [segmentation](https://huggingface.co/pyannote/segmentation-3.0).")
|