Fix intent classifier init

This commit is contained in:
Priler 2026-02-08 07:30:46 +05:00
parent 8e830334e8
commit b9d5f41bbd
5 changed files with 17 additions and 6 deletions

View file

@ -48,6 +48,8 @@ pub fn init(commands: &[JCommandsList]) -> Result<(), String> {
}
}
// info!("{}", model_dir.display());
let user_model = UserDefinedEmbeddingModel {
onnx_file: std::fs::read(model_dir.join("model.onnx"))
.map_err(|e| format!("Failed to read model.onnx: {}", e))?,
@ -194,6 +196,8 @@ pub fn classify(text: &str) -> Result<(String, f64), String> {
}
}
debug!("Embedding classify: '{}' -> '{}' ({:.2}%)", text, best_id, best_score * 100.0);
Ok((best_id, best_score))
}