fix: when model_id is an local dir, don't try to download model from remote

support-coreml
Meng Zhang 2023-06-02 13:48:53 -07:00
parent e3eae370be
commit 950a7a795f
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,11 @@ impl metadata::Metadata {
}
pub async fn download_model(model_id: &str, prefer_local_file: bool) {
if fs::metadata(model_id).is_ok() {
// Local path, no need for downloading.
return;
}
let mut metadata = metadata::Metadata::from(model_id).await;
metadata