From ca1fbc5789e6a7ea525d0d9aa4637b62b1ae5fac Mon Sep 17 00:00:00 2001 From: Josh Yan Date: Fri, 19 Jul 2024 15:23:30 -0700 Subject: [PATCH] cmt --- server/routes.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/routes.go b/server/routes.go index 5e3cdab72..8b5a7e2a2 100644 --- a/server/routes.go +++ b/server/routes.go @@ -614,11 +614,12 @@ func (s *Server) CreateModelHandler(c *gin.Context) { defer cancel() quantization := cmp.Or(r.Quantize, r.Quantization) - if err := CreateModel(ctx, name, filepath.Dir(r.Path), strings.ToUpper(quantization), f, fn); errors.Is(err, errBadTemplate) { - ch <- gin.H{"error": err.Error(), "status": http.StatusBadRequest} - } else if err != nil { + if err := CreateModel(ctx, name, filepath.Dir(r.Path), strings.ToUpper(quantization), f, fn); err != nil { + if errors.Is(err, errBadTemplate) { + ch <- gin.H{"error": err.Error(), "status": http.StatusBadRequest} + } ch <- gin.H{"error": err.Error()} - } + } }() if r.Stream != nil && !*r.Stream {