feat: add transcription diagnostics for empty result bug
This commit is contained in:
1 parent
b111ae0a76
commit
b2554006a4
7 files changed
+303
-11
No files matched your search
@@ -78,6 +78,23 @@ impl Transcriber for CrispAsrTranscriber {
|
||||
backend: "crispasr".to_string(),
|
||||
model_id: input.options.model_id,
|
||||
detected_language: input.options.language,
|
||||
attempt: Some(crate::diagnostics::TranscriptionAttempt {
|
||||
stage: "ok".to_string(),
|
||||
audio_path: input.audio_path.clone(),
|
||||
audio_size_bytes: crate::diagnostics::record_audio_size(&input.audio_path),
|
||||
sidecar: sidecar_name.clone(),
|
||||
model: model_path.display().to_string(),
|
||||
exit_code: output.status.code(),
|
||||
stdout_tail: crate::diagnostics::tail(
|
||||
&String::from_utf8_lossy(&output.stdout),
|
||||
1024,
|
||||
),
|
||||
stderr_tail: crate::diagnostics::tail(
|
||||
&String::from_utf8_lossy(&output.stderr),
|
||||
1024,
|
||||
),
|
||||
error: None,
|
||||
}),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ use std::path::PathBuf;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::diagnostics::TranscriptionAttempt;
|
||||
use crate::error::AppResult;
|
||||
use crate::models::DEFAULT_MODEL_ID;
|
||||
|
||||
@@ -40,6 +41,8 @@ pub struct TranscriptionResult {
|
||||
pub backend: String,
|
||||
pub model_id: String,
|
||||
pub detected_language: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub attempt: Option<TranscriptionAttempt>,
|
||||
}
|
||||
|
||||
pub trait Transcriber {
|
||||
|
||||
Reference in new issue
Block a user