Add Test & Download button for diarization model, clickable links
- Add diarize.download IPC handler that downloads the pyannote model and returns user-friendly error messages (missing license, bad token) - Add download_diarize_model Tauri command - Add "Test & Download Model" button in Speakers settings tab - Update instructions to list both required model licenses (speaker-diarization-3.1 AND segmentation-3.0) - Make all HuggingFace URLs clickable (opens in system browser) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,35 @@ pub fn transcribe_file(
|
||||
Ok(response.payload)
|
||||
}
|
||||
|
||||
/// Download and validate the diarization model via the Python sidecar.
|
||||
#[tauri::command]
|
||||
pub fn download_diarize_model(
|
||||
hf_token: String,
|
||||
) -> Result<Value, String> {
|
||||
let manager = sidecar();
|
||||
manager.ensure_running()?;
|
||||
|
||||
let request_id = uuid::Uuid::new_v4().to_string();
|
||||
let msg = IPCMessage::new(
|
||||
&request_id,
|
||||
"diarize.download",
|
||||
json!({
|
||||
"hf_token": hf_token,
|
||||
}),
|
||||
);
|
||||
|
||||
let response = manager.send_and_receive(&msg)?;
|
||||
|
||||
if response.msg_type == "error" {
|
||||
return Ok(json!({
|
||||
"ok": false,
|
||||
"error": response.payload.get("message").and_then(|v| v.as_str()).unwrap_or("unknown"),
|
||||
}));
|
||||
}
|
||||
|
||||
Ok(json!({ "ok": true }))
|
||||
}
|
||||
|
||||
/// Run the full transcription + diarization pipeline via the Python sidecar.
|
||||
#[tauri::command]
|
||||
pub fn run_pipeline(
|
||||
|
||||
Reference in New Issue
Block a user