Fix cargo fmt formatting and diarize threading test mock
This commit is contained in:
@@ -33,7 +33,11 @@ pub fn transcribe_file(
|
||||
if response.msg_type == "error" {
|
||||
return Err(format!(
|
||||
"Transcription error: {}",
|
||||
response.payload.get("message").and_then(|v| v.as_str()).unwrap_or("unknown")
|
||||
response
|
||||
.payload
|
||||
.get("message")
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("unknown")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -42,9 +46,7 @@ pub fn transcribe_file(
|
||||
|
||||
/// Download and validate the diarization model via the Python sidecar.
|
||||
#[tauri::command]
|
||||
pub fn download_diarize_model(
|
||||
hf_token: String,
|
||||
) -> Result<Value, String> {
|
||||
pub fn download_diarize_model(hf_token: String) -> Result<Value, String> {
|
||||
let manager = sidecar();
|
||||
manager.ensure_running()?;
|
||||
|
||||
@@ -116,7 +118,11 @@ pub fn run_pipeline(
|
||||
if response.msg_type == "error" {
|
||||
return Err(format!(
|
||||
"Pipeline error: {}",
|
||||
response.payload.get("message").and_then(|v| v.as_str()).unwrap_or("unknown")
|
||||
response
|
||||
.payload
|
||||
.get("message")
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("unknown")
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user