windows: fix model pulling

This commit is contained in:
Michael Yang
2023-07-20 11:23:43 -07:00
parent 2832801c2a
commit 6cea2061ec
2 changed files with 9 additions and 0 deletions

View File

@@ -854,6 +854,10 @@ func downloadBlob(mp ModelPath, digest string, username, password string, fn fun
})
if completed >= total {
if err := out.Close(); err != nil {
return err
}
if err := os.Rename(fp+"-partial", fp); err != nil {
fn(api.ProgressResponse{
Status: fmt.Sprintf("error renaming file: %v", err),