From a19d47642e49814c3fba634cd50a4898ce1a5a57 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Wed, 18 Oct 2023 15:55:50 -0700 Subject: [PATCH] models: rm workDir from CreateModel unused after removing EMBED --- server/images.go | 2 +- server/routes.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/images.go b/server/images.go index 5514c643..88d7a206 100644 --- a/server/images.go +++ b/server/images.go @@ -252,7 +252,7 @@ func filenameWithPath(path, f string) (string, error) { return f, nil } -func CreateModel(ctx context.Context, workDir, name string, path string, fn func(resp api.ProgressResponse)) error { +func CreateModel(ctx context.Context, name string, path string, fn func(resp api.ProgressResponse)) error { mp := ParseModelPath(name) var manifest *ManifestV2 diff --git a/server/routes.go b/server/routes.go index 3cee381e..71e01a34 100644 --- a/server/routes.go +++ b/server/routes.go @@ -334,8 +334,6 @@ func CreateModelHandler(c *gin.Context) { return } - workDir := c.GetString("workDir") - ch := make(chan any) go func() { defer close(ch) @@ -346,7 +344,7 @@ func CreateModelHandler(c *gin.Context) { ctx, cancel := context.WithCancel(c.Request.Context()) defer cancel() - if err := CreateModel(ctx, workDir, req.Name, req.Path, fn); err != nil { + if err := CreateModel(ctx, req.Name, req.Path, fn); err != nil { ch <- gin.H{"error": err.Error()} } }()