darker model name text

This commit is contained in:
2026-04-03 10:46:26 -06:00
parent 7c8c74d04d
commit f0568ed267
2 changed files with 17 additions and 3 deletions

View File

@ -43,16 +43,19 @@ pub fn transcribe_audio(
args.push(lang);
}
// Run Python script
// Run Python script with timeout
let output = Command::new(python_exe)
.args(&args)
.env("PYTHONPATH", crate::paths::project_root().join(".venv312").join("lib").join("python3.12").join("site-packages"))
.output()
.map_err(|e| format!("Failed to run Python script: {}", e))?;
// Check for timeout or other errors
if !output.status.success() {
let stderr = String::from_utf8_lossy(&output.stderr);
return Err(format!("Python script failed: {}", stderr));
let stdout = String::from_utf8_lossy(&output.stdout);
return Err(format!("Python script failed: {}\nStdout: {}\nStderr: {}",
output.status, stdout, stderr));
}
// Parse JSON output