Spaces:
Running on Zero
Running on Zero
fix: use gr.Group for input panels and add changelog emoji;docs: update changelog — settings auto-collapse feat: auto-collapse settings accordions after extraction
Browse files- docs/CHANGELOG.md +1 -0
- src/ui/event_wiring.py +8 -0
- src/ui/interface.py +6 -6
docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
## 29/03/2026
|
| 2 |
|
|
|
|
| 3 |
- Fixed crash on very long recordings (few hours), added warning message upon upload
|
| 4 |
- Added URL input mode — paste a link to download audio directly
|
| 5 |
- API calls are faster — skipped unnecessary audio processing for JSON-only responses
|
|
|
|
| 1 |
## 29/03/2026
|
| 2 |
|
| 3 |
+
- Settings panels now auto-collapse after extraction to reduce clutter, and re-expand when new audio is loaded
|
| 4 |
- Fixed crash on very long recordings (few hours), added warning message upon upload
|
| 5 |
- Added URL input mode — paste a link to download audio directly
|
| 6 |
- API calls are faster — skipped unnecessary audio processing for JSON-only responses
|
src/ui/event_wiring.py
CHANGED
|
@@ -203,6 +203,8 @@ def _wire_audio_input(c):
|
|
| 203 |
gr.update(visible=False), # resegment_toggle_btn
|
| 204 |
gr.update(visible=False), # retranscribe_btn
|
| 205 |
gr.update(visible=False), # resegment_panel
|
|
|
|
|
|
|
| 206 |
)
|
| 207 |
|
| 208 |
c.audio_input.change(
|
|
@@ -214,6 +216,7 @@ def _wire_audio_input(c):
|
|
| 214 |
c.cached_intervals, c.cached_model_name, c.cached_segment_dir, c.cached_log_row,
|
| 215 |
c.extract_btn, c.pipeline_progress, c.compute_ts_btn, c.compute_ts_progress, c.animate_all_html,
|
| 216 |
c.resegment_toggle_btn, c.retranscribe_btn, c.resegment_panel,
|
|
|
|
| 217 |
],
|
| 218 |
api_name=False, show_progress="hidden"
|
| 219 |
)
|
|
@@ -255,6 +258,7 @@ def _wire_extract_chain(c):
|
|
| 255 |
_skip, # compute_ts_btn
|
| 256 |
_skip, _skip, # resegment/retranscribe btns
|
| 257 |
_skip, _skip, _skip, _skip, # rs sliders + model
|
|
|
|
| 258 |
)
|
| 259 |
|
| 260 |
try:
|
|
@@ -276,6 +280,7 @@ def _wire_extract_chain(c):
|
|
| 276 |
_skip, # compute_ts_btn
|
| 277 |
_skip, _skip, # resegment/retranscribe
|
| 278 |
_skip, _skip, _skip, _skip, # rs sliders + model
|
|
|
|
| 279 |
)
|
| 280 |
return
|
| 281 |
# result: (html, json, speech_intervals, is_complete, audio, sr, intervals, seg_dir, log_row)
|
|
@@ -295,6 +300,8 @@ def _wire_extract_chain(c):
|
|
| 295 |
),
|
| 296 |
silence, speech, pad, # sync to resegment panel
|
| 297 |
model, # cache model name
|
|
|
|
|
|
|
| 298 |
)
|
| 299 |
|
| 300 |
c.extract_btn.click(
|
|
@@ -314,6 +321,7 @@ def _wire_extract_chain(c):
|
|
| 314 |
c.export_file, c.extract_btn, c.pipeline_progress, c.compute_ts_btn,
|
| 315 |
c.resegment_toggle_btn, c.retranscribe_btn,
|
| 316 |
c.rs_silence, c.rs_speech, c.rs_pad, c.cached_model_name,
|
|
|
|
| 317 |
],
|
| 318 |
api_name=False, show_progress="hidden"
|
| 319 |
)
|
|
|
|
| 203 |
gr.update(visible=False), # resegment_toggle_btn
|
| 204 |
gr.update(visible=False), # retranscribe_btn
|
| 205 |
gr.update(visible=False), # resegment_panel
|
| 206 |
+
gr.Accordion(open=True), # re-expand model_accordion
|
| 207 |
+
gr.Accordion(open=True), # re-expand seg_accordion
|
| 208 |
)
|
| 209 |
|
| 210 |
c.audio_input.change(
|
|
|
|
| 216 |
c.cached_intervals, c.cached_model_name, c.cached_segment_dir, c.cached_log_row,
|
| 217 |
c.extract_btn, c.pipeline_progress, c.compute_ts_btn, c.compute_ts_progress, c.animate_all_html,
|
| 218 |
c.resegment_toggle_btn, c.retranscribe_btn, c.resegment_panel,
|
| 219 |
+
c.model_accordion, c.seg_accordion,
|
| 220 |
],
|
| 221 |
api_name=False, show_progress="hidden"
|
| 222 |
)
|
|
|
|
| 258 |
_skip, # compute_ts_btn
|
| 259 |
_skip, _skip, # resegment/retranscribe btns
|
| 260 |
_skip, _skip, _skip, _skip, # rs sliders + model
|
| 261 |
+
_skip, _skip, # accordions
|
| 262 |
)
|
| 263 |
|
| 264 |
try:
|
|
|
|
| 280 |
_skip, # compute_ts_btn
|
| 281 |
_skip, _skip, # resegment/retranscribe
|
| 282 |
_skip, _skip, _skip, _skip, # rs sliders + model
|
| 283 |
+
_skip, _skip, # accordions
|
| 284 |
)
|
| 285 |
return
|
| 286 |
# result: (html, json, speech_intervals, is_complete, audio, sr, intervals, seg_dir, log_row)
|
|
|
|
| 300 |
),
|
| 301 |
silence, speech, pad, # sync to resegment panel
|
| 302 |
model, # cache model name
|
| 303 |
+
gr.Accordion(open=False), # collapse model_accordion
|
| 304 |
+
gr.Accordion(open=False), # collapse seg_accordion
|
| 305 |
)
|
| 306 |
|
| 307 |
c.extract_btn.click(
|
|
|
|
| 321 |
c.export_file, c.extract_btn, c.pipeline_progress, c.compute_ts_btn,
|
| 322 |
c.resegment_toggle_btn, c.retranscribe_btn,
|
| 323 |
c.rs_silence, c.rs_speech, c.rs_pad, c.cached_model_name,
|
| 324 |
+
c.model_accordion, c.seg_accordion,
|
| 325 |
],
|
| 326 |
api_name=False, show_progress="hidden"
|
| 327 |
)
|
src/ui/interface.py
CHANGED
|
@@ -56,7 +56,7 @@ def build_interface():
|
|
| 56 |
|
| 57 |
# Changelog accordion
|
| 58 |
_changelog = (Path(__file__).parent.parent.parent / "docs" / "CHANGELOG.md").read_text()
|
| 59 |
-
with gr.Accordion("Changelog", open=False):
|
| 60 |
gr.Markdown(_changelog)
|
| 61 |
|
| 62 |
if DEV_TAB_VISIBLE:
|
|
@@ -121,7 +121,7 @@ def _build_left_column(c):
|
|
| 121 |
elem_classes=["mode-active"] if _is_record else [])
|
| 122 |
|
| 123 |
# Link panel
|
| 124 |
-
with gr.
|
| 125 |
c.url_input = gr.Textbox(
|
| 126 |
label="Paste a link",
|
| 127 |
info='e.g. TikTok · SoundCloud · [MP3Quran](https://www.mp3quran.net/) · [all supported sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)',
|
|
@@ -133,7 +133,7 @@ def _build_left_column(c):
|
|
| 133 |
c.url_audio_player = gr.Audio(label="Downloaded Audio", visible=False, interactive=False)
|
| 134 |
|
| 135 |
# Upload panel
|
| 136 |
-
with gr.
|
| 137 |
with gr.Row(elem_id="example-row"):
|
| 138 |
c.btn_ex_112 = gr.Button("112", size="sm", min_width=0)
|
| 139 |
c.btn_ex_84 = gr.Button("84", size="sm", min_width=0)
|
|
@@ -142,7 +142,7 @@ def _build_left_column(c):
|
|
| 142 |
c.audio_upload = gr.Audio(label="Upload Recitation", sources=["upload"], type="filepath")
|
| 143 |
|
| 144 |
# Record panel
|
| 145 |
-
with gr.
|
| 146 |
c.audio_record = gr.Audio(label="Record Recitation", sources=["microphone"], type="filepath")
|
| 147 |
|
| 148 |
# Hidden unified audio (fed by upload, record, or URL download)
|
|
@@ -151,7 +151,7 @@ def _build_left_column(c):
|
|
| 151 |
_build_animation_settings(c)
|
| 152 |
|
| 153 |
c.anim_cached_settings = gr.JSON(value=None, visible=False)
|
| 154 |
-
with gr.Accordion("Model Settings", open=True):
|
| 155 |
with gr.Row():
|
| 156 |
c.model_radio = gr.Radio(
|
| 157 |
choices=["Base", "Large"],
|
|
@@ -166,7 +166,7 @@ def _build_left_column(c):
|
|
| 166 |
info="Daily GPU usage limits. Unlimitted CPU usage but slower"
|
| 167 |
)
|
| 168 |
|
| 169 |
-
with gr.Accordion("Segmentation Settings", open=True):
|
| 170 |
c.min_silence_slider, c.min_speech_slider, c.pad_slider, \
|
| 171 |
c.preset_mujawwad, c.preset_murattal, c.preset_fast = create_segmentation_settings()
|
| 172 |
|
|
|
|
| 56 |
|
| 57 |
# Changelog accordion
|
| 58 |
_changelog = (Path(__file__).parent.parent.parent / "docs" / "CHANGELOG.md").read_text()
|
| 59 |
+
with gr.Accordion("📋 Changelog", open=False):
|
| 60 |
gr.Markdown(_changelog)
|
| 61 |
|
| 62 |
if DEV_TAB_VISIBLE:
|
|
|
|
| 121 |
elem_classes=["mode-active"] if _is_record else [])
|
| 122 |
|
| 123 |
# Link panel
|
| 124 |
+
with gr.Group(visible=_is_link, elem_id="link-panel") as c.link_panel:
|
| 125 |
c.url_input = gr.Textbox(
|
| 126 |
label="Paste a link",
|
| 127 |
info='e.g. TikTok · SoundCloud · [MP3Quran](https://www.mp3quran.net/) · [all supported sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)',
|
|
|
|
| 133 |
c.url_audio_player = gr.Audio(label="Downloaded Audio", visible=False, interactive=False)
|
| 134 |
|
| 135 |
# Upload panel
|
| 136 |
+
with gr.Group(visible=_is_upload, elem_id="upload-panel") as c.upload_panel:
|
| 137 |
with gr.Row(elem_id="example-row"):
|
| 138 |
c.btn_ex_112 = gr.Button("112", size="sm", min_width=0)
|
| 139 |
c.btn_ex_84 = gr.Button("84", size="sm", min_width=0)
|
|
|
|
| 142 |
c.audio_upload = gr.Audio(label="Upload Recitation", sources=["upload"], type="filepath")
|
| 143 |
|
| 144 |
# Record panel
|
| 145 |
+
with gr.Group(visible=_is_record, elem_id="record-panel") as c.record_panel:
|
| 146 |
c.audio_record = gr.Audio(label="Record Recitation", sources=["microphone"], type="filepath")
|
| 147 |
|
| 148 |
# Hidden unified audio (fed by upload, record, or URL download)
|
|
|
|
| 151 |
_build_animation_settings(c)
|
| 152 |
|
| 153 |
c.anim_cached_settings = gr.JSON(value=None, visible=False)
|
| 154 |
+
with gr.Accordion("Model Settings", open=True) as c.model_accordion:
|
| 155 |
with gr.Row():
|
| 156 |
c.model_radio = gr.Radio(
|
| 157 |
choices=["Base", "Large"],
|
|
|
|
| 166 |
info="Daily GPU usage limits. Unlimitted CPU usage but slower"
|
| 167 |
)
|
| 168 |
|
| 169 |
+
with gr.Accordion("Segmentation Settings", open=True) as c.seg_accordion:
|
| 170 |
c.min_silence_slider, c.min_speech_slider, c.pad_slider, \
|
| 171 |
c.preset_mujawwad, c.preset_murattal, c.preset_fast = create_segmentation_settings()
|
| 172 |
|