From 0cebc79cba778d3d504405c3973dd9f2507b1ab0 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Fri, 8 Mar 2024 12:27:47 -0500 Subject: [PATCH] fix: allow importing a model from name reference (#3005) --- server/images.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/images.go b/server/images.go index abd8d780..2ae2fadc 100644 --- a/server/images.go +++ b/server/images.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "io/fs" "log" "log/slog" "net/http" @@ -322,9 +323,12 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars ggufName, err := convertSafetensors(name, pathName) if err != nil { + var pathErr *fs.PathError switch { case errors.Is(err, zip.ErrFormat): // it's not a safetensor archive + case errors.As(err, &pathErr): + // it's not a file on disk, could be a model reference default: return err }