feat: wakeword engine checkboxes + wakeword model selector in benchmark (v2.03.19)

- Engine checkboxes let you pick which wakeword servers to include in the run
- Wakeword combo selects which model/phrase to test; leave empty for each
  engine's own, pick a specific one (e.g. okay_computer) to override all
- Also fixes: TTS ⟳ no longer fills model combo with Kokoro voice names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mARTin-B78 2026-06-10 01:13:54 +02:00
parent b20aa31261
commit 66e431f50a
3 changed files with 57 additions and 2 deletions

View File

@ -9,6 +9,17 @@ The version is defined in [`blitztext/__init__.py`](blitztext/__init__.py).
## [Unreleased]
## [2.03.19] - 2026-06-10
### Added
- **Wakeword engine checkboxes in benchmark.** A row of checkboxes above the
"Run wakeword benchmark" button lets you pick which engines to include.
All are checked by default.
- **Wakeword model selector in benchmark.** A "Wakeword" combo lets you
override which wakeword phrase (model) to test. Leave empty for the default
(each engine uses its own configured model). Pick a specific model (e.g.
`okay_computer`) to test that phrase on every selected engine.
## [2.03.18] - 2026-06-10
### Fixed

View File

@ -6,4 +6,4 @@ counterpart to the macOS Blitztext menu bar app: it runs natively on the host
(not in a container) so it can type into any application via xdotool.
"""
__version__ = "2.03.18"
__version__ = "2.03.19"

View File

@ -2387,6 +2387,33 @@ notebook.bt-nb tab:checked label {
connect_box.pack_start(self.wwb_test_lbl, False, False, 0)
_labeled(page, "", connect_box)
# ---- Wakeword engine checkboxes ----
_section_title(page, "Engines to test", margin_top=10,
icon="audio-input-microphone-symbolic")
self._wwb_checks: dict[str, Gtk.CheckButton] = {}
eng_row = Gtk.Box(spacing=16)
eng_row.set_margin_bottom(4)
for e in self.cfg.wakeword_engines:
cb = Gtk.CheckButton(label=e.name)
cb.set_active(True)
self._wwb_checks[e.name] = cb
eng_row.pack_start(cb, False, False, 0)
if not self.cfg.wakeword_engines:
eng_row.pack_start(Gtk.Label(label="(no wakeword engines configured — add one in the Input tab)"),
False, False, 0)
page.pack_start(eng_row, False, False, 0)
# ---- Wakeword model selector ----
all_ww_models = list(dict.fromkeys(
e.model for e in self.cfg.wakeword_engines if e.model))
self.wwb_wakeword = _model_combo("auto — each engine's own model")
self.wwb_wakeword.set_models(all_ww_models)
_labeled(page, "Wakeword", self.wwb_wakeword,
tooltip="Which wakeword model to test. Leave empty to use each engine's own "
"configured model. Select a specific model to override all engines "
"and test that phrase (e.g. okay_computer on all servers).")
# ---- Samples + run ----
adj = Gtk.Adjustment(value=12, lower=1, upper=200, step_increment=1, page_increment=10)
self.wwb_count = Gtk.SpinButton(adjustment=adj, climb_rate=1, digits=0)
self.wwb_count.set_halign(Gtk.Align.START); self.wwb_count.set_size_request(90, -1)
@ -2589,6 +2616,23 @@ notebook.bt-nb tab:checked label {
if not voices:
self._error("Add at least one voice (or press Connect to fetch them).")
return
# Filter engines by checkboxes
checks = getattr(self, "_wwb_checks", {})
engines = [e for e in self.cfg.wakeword_engines
if not checks or checks.get(e.name, Gtk.CheckButton(active=True)).get_active()]
if not engines:
self._error("Select at least one wakeword engine to benchmark.")
return
# Override wakeword model if the user picked a specific one
ww_override = self.wwb_wakeword.get_text().strip() if hasattr(self, "wwb_wakeword") else ""
if ww_override:
import copy as _copy
engines = [_copy.copy(e) for e in engines]
for e in engines:
e.model = ww_override
self.wwb_summary.set_markup("<i>Synthesizing and streaming… this talks to your TTS "
"and wyoming-openwakeword servers.</i>")
@ -2597,7 +2641,7 @@ notebook.bt-nb tab:checked label {
GLib.idle_add(self._wwbench_progress, ei, n_eng, eng_name, ui, total, u)
try:
runs = wakeword_bench.run(
self.cfg.wakeword_engines,
engines,
tts_url=url, tts_api_key_env=key, tts_model=model, voices=voices,
language=self.cfg.language, count=count, progress=prog)
except Exception as exc: # noqa: BLE001 - surface setup errors