feat(ui): load/download/remove diarization models in the settings store

This commit is contained in:
iamdoubz committed 2026-07-11 00:23:18 -05:00
1 parent bf644ea0be
commit 5260a4240b
1 file changed
+28
+28
View File
@@ -61,6 +61,10 @@ class SettingsStore {
// Hardware + model management (Phase 3, T3.6/T3.7).
hardware = $state<HardwareStatus | null>(null);
models = $state<ModelInfo[]>([]);
// Speaker-diarization models (segmentation + embedding). Both must be
// installed before recordings separate speakers instead of labelling
// everything "S1" (T4.7, FR-MODEL-1).
diarizationModels = $state<ModelInfo[]>([]);
// Transcription language catalog for the Settings dropdown (T8.7, FR-TRX-4).
languages = $state<LanguageOption[]>([]);
audioDevices = $state<AudioDeviceInfo[]>([]);
@@ -101,6 +105,7 @@ class SettingsStore {
await this.loadAudioDevices();
await this.loadInputDevices();
await this.loadModels();
await this.loadDiarizationModels();
await this.loadLanguages();
await this.loadPrivacy();
await this.loadLlmStatus();
@@ -199,6 +204,29 @@ class SettingsStore {
}
}
async loadDiarizationModels() {
try {
this.diarizationModels = await api.listDiarizationModels();
} catch {
this.diarizationModels = [];
}
}
/** Download one diarization model. The two known ids map to the backend's
* `diar-seg`/`diar-emb` kinds; `removeModel` needs no kind (it disambiguates
* by catalog membership). */
async downloadDiarizationModel(id: string) {
this.clearProgress(id);
await api.downloadModel(id, id.startsWith("seg") ? "diar-seg" : "diar-emb");
this.clearProgress(id);
await this.loadDiarizationModels();
}
async removeDiarizationModel(id: string) {
await api.removeModel(id);
await this.loadDiarizationModels();
}
async loadLanguages() {
try {
this.languages = await api.listWhisperLanguages();