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(
|
||||
|
||||
@@ -12,7 +12,7 @@ use commands::export::export_transcript;
|
||||
use commands::project::{create_project, get_project, list_projects};
|
||||
use commands::settings::{load_settings, save_settings};
|
||||
use commands::system::{get_data_dir, llama_list_models, llama_start, llama_status, llama_stop};
|
||||
use commands::transcribe::{run_pipeline, transcribe_file};
|
||||
use commands::transcribe::{download_diarize_model, run_pipeline, transcribe_file};
|
||||
use state::AppState;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
@@ -36,6 +36,7 @@ pub fn run() {
|
||||
list_projects,
|
||||
transcribe_file,
|
||||
run_pipeline,
|
||||
download_diarize_model,
|
||||
export_transcript,
|
||||
ai_chat,
|
||||
ai_list_providers,
|
||||
|
||||
Reference in New Issue
Block a user