mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-12 16:57:04 +00:00
if directory cannot be resolved, do not fail
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
@@ -50,6 +51,10 @@ func pull(model string) error {
|
||||
context.Background(),
|
||||
&api.PullRequest{Model: model},
|
||||
func(progress api.PullProgress) error {
|
||||
if progress.Error.Code == http.StatusBadGateway {
|
||||
// couldn't pull the model from the directory, proceed in offline mode
|
||||
return nil
|
||||
}
|
||||
if bar == nil && progress.Percent == 100 {
|
||||
// already downloaded
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user