Spaces:
Running
on
Zero
Running
on
Zero
fix layout err
Browse files
app.py
CHANGED
@@ -306,7 +306,16 @@ def transcribe_sense(model_id: str,
|
|
306 |
|
307 |
|
308 |
# —————— Gradio UI ——————
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
with Demo:
|
311 |
gr.Markdown("## Whisper vs. SenseVoice (Language, Device & Diarization with Simplified→Traditional Chinese)")
|
312 |
|
@@ -330,7 +339,7 @@ with Demo:
|
|
330 |
device_radio = gr.Radio(choices=["GPU", "CPU"], value="GPU", label="Device")
|
331 |
diar_check = gr.Checkbox(label="Enable Diarization", value=True)
|
332 |
out_w = gr.Textbox(label="Transcript", visible=False)
|
333 |
-
out_w_d = gr.HTML(label="Diarized Transcript", visible=True)
|
334 |
# Toggle visibility based on checkbox
|
335 |
diar_check.change(lambda e: gr.update(visible=not e), inputs=diar_check, outputs=out_w)
|
336 |
diar_check.change(lambda e: gr.update(visible=e), inputs=diar_check, outputs=out_w_d)
|
@@ -347,7 +356,7 @@ with Demo:
|
|
347 |
punct_chk = gr.Checkbox(label="Enable Punctuation", value=True)
|
348 |
diar_s_chk = gr.Checkbox(label="Enable Diarization", value=True)
|
349 |
out_s = gr.Textbox(label="Transcript", visible=False)
|
350 |
-
out_s_d = gr.HTML(label="Diarized Transcript", visible=True)
|
351 |
# Toggle visibility
|
352 |
diar_s_chk.change(lambda e: gr.update(visible=not e), inputs=diar_s_chk, outputs=out_s)
|
353 |
diar_s_chk.change(lambda e: gr.update(visible=e), inputs=diar_s_chk, outputs=out_s_d)
|
|
|
306 |
|
307 |
|
308 |
# —————— Gradio UI ——————
|
309 |
+
DEMO_CSS = """
|
310 |
+
.diar {
|
311 |
+
min-height: 100px !important;
|
312 |
+
max-height: 300px;
|
313 |
+
overflow-y: auto;
|
314 |
+
padding: 8px;
|
315 |
+
border: 1px solid #444;
|
316 |
+
}
|
317 |
+
"""
|
318 |
+
Demo = gr.Blocks(css=DEMO_CSS)
|
319 |
with Demo:
|
320 |
gr.Markdown("## Whisper vs. SenseVoice (Language, Device & Diarization with Simplified→Traditional Chinese)")
|
321 |
|
|
|
339 |
device_radio = gr.Radio(choices=["GPU", "CPU"], value="GPU", label="Device")
|
340 |
diar_check = gr.Checkbox(label="Enable Diarization", value=True)
|
341 |
out_w = gr.Textbox(label="Transcript", visible=False)
|
342 |
+
out_w_d = gr.HTML(label="Diarized Transcript", visible=True, elem_classes=["diar"])
|
343 |
# Toggle visibility based on checkbox
|
344 |
diar_check.change(lambda e: gr.update(visible=not e), inputs=diar_check, outputs=out_w)
|
345 |
diar_check.change(lambda e: gr.update(visible=e), inputs=diar_check, outputs=out_w_d)
|
|
|
356 |
punct_chk = gr.Checkbox(label="Enable Punctuation", value=True)
|
357 |
diar_s_chk = gr.Checkbox(label="Enable Diarization", value=True)
|
358 |
out_s = gr.Textbox(label="Transcript", visible=False)
|
359 |
+
out_s_d = gr.HTML(label="Diarized Transcript", visible=True, elem_classes=["diar"])
|
360 |
# Toggle visibility
|
361 |
diar_s_chk.change(lambda e: gr.update(visible=not e), inputs=diar_s_chk, outputs=out_s)
|
362 |
diar_s_chk.change(lambda e: gr.update(visible=e), inputs=diar_s_chk, outputs=out_s_d)
|