Skip to content

Commit 855dc50

Browse files
committed
Fix handling of download_onnx function output
Prevents the logging message "Model ONNX weights downloaded in ..." from showing whenever those are either not present or not downloaded
1 parent bc17257 commit 855dc50

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

backends/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,12 @@ async fn init_backend(
338338
{
339339
if let Some(api_repo) = api_repo.as_ref() {
340340
let start = std::time::Instant::now();
341-
download_onnx(api_repo)
342-
.await
343-
.map_err(|err| BackendError::WeightsNotFound(err.to_string()));
344-
tracing::info!("Model ONNX weights downloaded in {:?}", start.elapsed());
341+
match download_onnx(api_repo).await {
342+
Ok(_) => {
343+
tracing::info!("Model ONNX weights downloaded in {:?}", start.elapsed())
344+
}
345+
Err(err) => BackendError::WeightsNotFound(err.to_string()),
346+
}
345347
}
346348

347349
let backend = OrtBackend::new(&model_path, dtype.to_string(), model_type.clone());

0 commit comments

Comments
 (0)