Commit a19d4764 authored by Michael Yang's avatar Michael Yang
Browse files

models: rm workDir from CreateModel

unused after removing EMBED
parent a7dad24d
......@@ -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
......
......@@ -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()}
}
}()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment