Skip to content

Commit be4f0cd

Browse files
committed
fix(setup): simplify Parakeet variant UI — minimal labels, grey instead of ACTIVE badge
User feedback on previous iteration: - Don't repeat "Parakeet-TDT 0.6B v3" in the variant row title — the ASR backend combobox already identifies the model family. - Move the long description from the row title (same line as the bold name) to a smaller second line below. - Drop the green ACTIVE pill. Instead grey out (color: #888) the variant that is NOT currently selected by the toggle. The selected one keeps full colour — easier to read at a glance, no badge clutter. - Same treatment for the Sortformer section title. New layout: ┌─ Parakeet TDT ─────────────────────────────────────┐ │ FP32 ★ Recommended │ ← full color when selected │ Full precision. 25 languages with native... │ │ [Install] │ │ │ │ INT8 │ ← #888 grey if not selected │ Quantized variant. ~3.6× smaller, ~34 % faster... │ │ [Install] │ │ │ │ Active variant: FP32 [━━━●] INT8 │ │ ★ Recommended for your hardware: int8 — ... │ └────────────────────────────────────────────────────┘ ┌─ Sortformer ───────────────────────────────────────┐ │ Sortformer │ │ Speaker diarization add-on. Identifies up to 4... │ │ [Install] [Delete] │ └────────────────────────────────────────────────────┘ Grey color updates live when the toggle flips (still via toggled signal, no rebuild needed).
1 parent a127371 commit be4f0cd

1 file changed

Lines changed: 45 additions & 44 deletions

File tree

dictee-setup.py

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8133,56 +8133,64 @@ def _fix_input_group():
81338133
self._refresh_shortcut_combos_labels()
81348134

81358135
_MODEL_DESCRIPTIONS = {
8136-
"tdt": "Main transcription model (FP32 full precision). "
8137-
"Supports 25 languages with native punctuation and capitalization.",
8138-
"tdt-int8": "Quantized variant. Same 25 languages, ~3.6× smaller, "
8139-
"~34 % faster on CPU. Best for CPU-only or low-VRAM GPU.",
8136+
"tdt": "Full precision. 25 languages with native punctuation and capitalization.",
8137+
"tdt-int8": "Quantized variant. ~3.6× smaller, ~34 % faster on CPU. "
8138+
"Best for CPU-only or low-VRAM GPU.",
81408139
"sortformer": "Speaker diarization add-on. Identifies up to 4 speakers "
81418140
"in a recording. Optional — only needed for speaker identification.",
81428141
}
81438142

81448143
def _make_model_label_html(self, model, active_quant, recommended_quant):
8145-
"""Generate HTML for a model's description label, with ★ Recommended and ACTIVE badges."""
8146-
installed = model_is_installed(model)
8147-
model_quant = model.get("quant")
8148-
badges_html = ""
8144+
"""Generate two-line HTML for a model entry:
8145+
- Line 1: "FP32" or "INT8" (or model name for non-TDT) — bold + ★ Recommended badge
8146+
- Line 2: description in smaller font
8147+
Non-active TDT variant is rendered greyed out (color: #888) on both lines."""
8148+
model_quant = model.get("quant") # "fp32", "int8", or None
8149+
8150+
# Title line: variant code in uppercase for TDT, or full model name otherwise
8151+
if model_quant:
8152+
title = model_quant.upper() # "FP32" or "INT8"
8153+
is_active = (model_quant == active_quant)
8154+
inactive_color = " color:#888;" if not is_active else ""
8155+
else:
8156+
title = model["name"]
8157+
is_active = True # non-TDT models are always "active" (no quant choice)
8158+
inactive_color = ""
8159+
8160+
# ★ Recommended badge on the hardware-suggested variant
8161+
badge_html = ""
81498162
if model_quant and model_quant == recommended_quant:
8150-
badges_html += (
8163+
badge_html = (
81518164
" <span style='color:#d8a000; font-size:10pt; font-weight:bold;'>★ "
81528165
+ _("Recommended") + "</span>"
81538166
)
8154-
if model_quant and model_quant == active_quant and installed:
8155-
badges_html += (
8156-
" <span style='background:#2a7d3a; color:white; padding:2px 8px;"
8157-
" border-radius:4px; font-size:10pt; font-weight:bold;'>"
8158-
+ _("ACTIVE") + "</span>"
8159-
)
8167+
81608168
desc_text = _(self._MODEL_DESCRIPTIONS.get(model["id"], ""))
8161-
return (f"<p style='font-size: 11pt;'><b>{model['name']}</b>"
8162-
f"{badges_html} — {desc_text}</p>")
8169+
8170+
return (
8171+
f"<p style='margin:0; line-height:1.2;'>"
8172+
f"<span style='font-size:12pt; font-weight:bold;{inactive_color}'>{title}</span>"
8173+
f"{badge_html}"
8174+
f"<br/>"
8175+
f"<span style='font-size:9pt;{inactive_color}'>{desc_text}</span>"
8176+
f"</p>"
8177+
)
81638178

81648179
def _refresh_tdt_active_badge(self):
8165-
"""Live-update ACTIVE badges on TDT model labels + side labels around the
8166-
toggle switch when the user flips it. Called by ToggleSwitch.toggled,
8167-
before Apply, so the user gets immediate visual feedback."""
8180+
"""Live-update TDT model labels when the toggle flips: the selected
8181+
variant stays at full colour, the other goes grey. Called by
8182+
ToggleSwitch.toggled — no need to wait for Apply."""
81688183
if not hasattr(self, 'tgl_quant'):
81698184
return
81708185
new_active = "int8" if self.tgl_quant.isChecked() else "fp32"
81718186
recommended = suggest_parakeet_quant()
8172-
# 1) Refresh badges on the 2 TDT model rows
81738187
for model in ASR_MODELS:
81748188
if model.get("quant") not in ("fp32", "int8"):
81758189
continue
81768190
widgets = self._model_widgets.get(model["id"])
81778191
if widgets and widgets.get("desc_label"):
81788192
widgets["desc_label"].setText(
81798193
self._make_model_label_html(model, new_active, recommended))
8180-
# 2) Bold the side label of the currently-selected variant
8181-
if hasattr(self, '_lbl_toggle_fp32') and hasattr(self, '_lbl_toggle_int8'):
8182-
self._lbl_toggle_fp32.setText(
8183-
"<b>FP32</b>" if new_active == "fp32" else "FP32")
8184-
self._lbl_toggle_int8.setText(
8185-
"<b>INT8</b>" if new_active == "int8" else "INT8")
81868194

81878195
def _build_parakeet_options(self, parent_layout):
81888196
"""Build Parakeet + Sortformer model download UI.
@@ -8260,8 +8268,9 @@ def _build_model_row(layout, model):
82608268
"btn_cancel": btn_cancel, "progress": progress, "model": model,
82618269
}
82628270

8263-
# === Parakeet group box ===
8264-
parakeet_box = QGroupBox(_("Parakeet TDT — Main transcription model"))
8271+
# === Parakeet group box (no subtitle — the ASR backend combobox already
8272+
# identifies the model family). Just "Parakeet TDT" as section anchor. ===
8273+
parakeet_box = QGroupBox(_("Parakeet TDT"))
82658274
parakeet_lay = QVBoxLayout(parakeet_box)
82668275
parakeet_lay.setContentsMargins(12, 12, 12, 10)
82678276
parakeet_lay.setSpacing(6)
@@ -8278,18 +8287,15 @@ def _build_model_row(layout, model):
82788287
)
82798288

82808289
# Toggle switch: unchecked = FP32 (left), checked = INT8 (right).
8281-
# Layout: "Active variant: FP32 [——●] INT8" (bold side = selected)
8290+
# The variants above are greyed out when not selected, so the toggle
8291+
# state is visually obvious without extra side labels.
82828292
toggle_row = QHBoxLayout()
82838293
toggle_row.setContentsMargins(0, 6, 0, 0)
82848294
toggle_row.addWidget(QLabel("<b>" + _("Active variant:") + "</b>"))
82858295
toggle_row.addSpacing(12)
8296+
toggle_row.addWidget(QLabel("FP32"))
82868297

8287-
self._lbl_toggle_fp32 = QLabel(
8288-
"<b>FP32</b>" if active_quant == "fp32" else "FP32")
8289-
self._lbl_toggle_fp32.setStyleSheet("QLabel { font-size: 11pt; }")
8290-
toggle_row.addWidget(self._lbl_toggle_fp32)
8291-
8292-
self.tgl_quant = ToggleSwitch("") # standalone toggle, labels are external
8298+
self.tgl_quant = ToggleSwitch("")
82938299
self.tgl_quant.setChecked(active_quant == "int8")
82948300
# Enable only if BOTH variants are installed; otherwise auto-resolved + disabled
82958301
both_installed = fp32_installed and int8_installed
@@ -8298,15 +8304,10 @@ def _build_model_row(layout, model):
82988304
self.tgl_quant.setChecked(False)
82998305
elif int8_installed and not fp32_installed:
83008306
self.tgl_quant.setChecked(True)
8301-
# Live refresh of ACTIVE badge and side-label bolding
83028307
self.tgl_quant.toggled.connect(self._refresh_tdt_active_badge)
83038308
toggle_row.addWidget(self.tgl_quant)
83048309

8305-
self._lbl_toggle_int8 = QLabel(
8306-
"<b>INT8</b>" if active_quant == "int8" else "INT8")
8307-
self._lbl_toggle_int8.setStyleSheet("QLabel { font-size: 11pt; }")
8308-
toggle_row.addWidget(self._lbl_toggle_int8)
8309-
8310+
toggle_row.addWidget(QLabel("INT8"))
83108311
toggle_row.addStretch()
83118312
parakeet_lay.addLayout(toggle_row)
83128313

@@ -8328,8 +8329,8 @@ def _build_model_row(layout, model):
83288329

83298330
lay_outer.addWidget(parakeet_box)
83308331

8331-
# === Sortformer group box (separate) ===
8332-
sortformer_box = QGroupBox(_("Sortformer — Speaker diarization (optional)"))
8332+
# === Sortformer group box (separate, simple title) ===
8333+
sortformer_box = QGroupBox(_("Sortformer"))
83338334
sortformer_lay = QVBoxLayout(sortformer_box)
83348335
sortformer_lay.setContentsMargins(12, 12, 12, 10)
83358336
sortformer_lay.setSpacing(6)

0 commit comments

Comments
 (0)