Update app.py
Browse files
app.py
CHANGED
|
@@ -114,17 +114,14 @@ class App:
|
|
| 114 |
with gr.Row():
|
| 115 |
cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate output to selected language", info="Translate using Facebook's NLLB",interactive=True)
|
| 116 |
|
| 117 |
-
# with gr.Accordion("Speaker diarization", open=False, visible=True):
|
| 118 |
-
# cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"], label="Use diarization",interactive=True)
|
| 119 |
-
# tb_hf_token = gr.Text(label="Token", value=diarization_params["hf_token"],info="Required to use diarization")
|
| 120 |
-
# gr.Markdown("""
|
| 121 |
-
# An access token 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).
|
| 122 |
-
# """)
|
| 123 |
-
|
| 124 |
with gr.Accordion("Speaker diarization", open=False, visible=True):
|
| 125 |
cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Use diarization",interactive=True)
|
| 126 |
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)")
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
with gr.Accordion("Voice Detection Filter", open=False, visible=True):
|
| 129 |
cb_vad_filter = gr.Checkbox(label="Enable Silero VAD Filter", value=vad_params["vad_filter"],
|
| 130 |
interactive=True,
|
|
@@ -147,9 +144,9 @@ class App:
|
|
| 147 |
|
| 148 |
with gr.Accordion("Advanced options", open=False, visible=True):
|
| 149 |
with gr.Accordion("Advanced diarization options", open=False, visible=True):
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
|
| 154 |
with gr.Accordion("Advanced processing options", open=False):
|
| 155 |
nb_beam_size = gr.Number(label="Beam Size", value=whisper_params["beam_size"], precision=0, interactive=True,
|
|
@@ -235,25 +232,6 @@ class App:
|
|
| 235 |
cb_uvr_enable_offload = gr.Checkbox(label="Offload sub model after removing background music",
|
| 236 |
value=uvr_params["enable_offload"])
|
| 237 |
|
| 238 |
-
# with gr.Accordion("Voice Detection Filter", open=False):
|
| 239 |
-
# cb_vad_filter = gr.Checkbox(label="Enable Silero VAD Filter", value=vad_params["vad_filter"],
|
| 240 |
-
# interactive=True,
|
| 241 |
-
# info="Enable this to transcribe only detected voice parts by submodel.")
|
| 242 |
-
# sd_threshold = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, label="Speech Threshold",
|
| 243 |
-
# value=vad_params["threshold"],
|
| 244 |
-
# info="Lower it to be more sensitive to small sounds.")
|
| 245 |
-
# nb_min_speech_duration_ms = gr.Number(label="Minimum Speech Duration (ms)", precision=0,
|
| 246 |
-
# value=vad_params["min_speech_duration_ms"],
|
| 247 |
-
# info="Final speech chunks shorter than this time are thrown out")
|
| 248 |
-
# nb_max_speech_duration_s = gr.Number(label="Maximum Speech Duration (s)",
|
| 249 |
-
# value=vad_params["max_speech_duration_s"],
|
| 250 |
-
# info="Maximum duration of speech chunks in \"seconds\".")
|
| 251 |
-
# nb_min_silence_duration_ms = gr.Number(label="Minimum Silence Duration (ms)", precision=0,
|
| 252 |
-
# value=vad_params["min_silence_duration_ms"],
|
| 253 |
-
# info="In the end of each speech chunk wait for this time"
|
| 254 |
-
# " before separating it")
|
| 255 |
-
# nb_speech_pad_ms = gr.Number(label="Speech Padding (ms)", precision=0, value=vad_params["speech_pad_ms"],
|
| 256 |
-
# info="Final speech chunks are padded by this time each side")
|
| 257 |
|
| 258 |
#dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
|
| 259 |
|
|
|
|
| 114 |
with gr.Row():
|
| 115 |
cb_translate_output = gr.Checkbox(value=translation_params["translate_output"], label="Translate output to selected language", info="Translate using Facebook's NLLB",interactive=True)
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
with gr.Accordion("Speaker diarization", open=False, visible=True):
|
| 118 |
cb_diarize = gr.Checkbox(value=diarization_params["is_diarize"],label="Use diarization",interactive=True)
|
| 119 |
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)")
|
| 120 |
+
dd_diarization_device = gr.Dropdown(label="Device",
|
| 121 |
+
choices=self.whisper_inf.diarizer.get_available_device(),
|
| 122 |
+
value=self.whisper_inf.diarizer.get_device(),
|
| 123 |
+
interactive=True, visible=False)
|
| 124 |
+
|
| 125 |
with gr.Accordion("Voice Detection Filter", open=False, visible=True):
|
| 126 |
cb_vad_filter = gr.Checkbox(label="Enable Silero VAD Filter", value=vad_params["vad_filter"],
|
| 127 |
interactive=True,
|
|
|
|
| 144 |
|
| 145 |
with gr.Accordion("Advanced options", open=False, visible=True):
|
| 146 |
with gr.Accordion("Advanced diarization options", open=False, visible=True):
|
| 147 |
+
# dd_diarization_device = gr.Dropdown(label="Device",
|
| 148 |
+
# choices=self.whisper_inf.diarizer.get_available_device(),
|
| 149 |
+
# value=self.whisper_inf.diarizer.get_device())
|
| 150 |
|
| 151 |
with gr.Accordion("Advanced processing options", open=False):
|
| 152 |
nb_beam_size = gr.Number(label="Beam Size", value=whisper_params["beam_size"], precision=0, interactive=True,
|
|
|
|
| 232 |
cb_uvr_enable_offload = gr.Checkbox(label="Offload sub model after removing background music",
|
| 233 |
value=uvr_params["enable_offload"])
|
| 234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
#dd_model.change(fn=self.on_change_models, inputs=[dd_model], outputs=[cb_translate])
|
| 237 |
|