bad request to templ err
This commit is contained in:
parent
f7b6cd7934
commit
3e89435605
@ -614,8 +614,12 @@ func (s *Server) CreateModelHandler(c *gin.Context) {
|
|||||||
|
|
||||||
quantization := cmp.Or(r.Quantize, r.Quantization)
|
quantization := cmp.Or(r.Quantize, r.Quantization)
|
||||||
if err := CreateModel(ctx, name, filepath.Dir(r.Path), strings.ToUpper(quantization), f, fn); err != nil {
|
if err := CreateModel(ctx, name, filepath.Dir(r.Path), strings.ToUpper(quantization), f, fn); err != nil {
|
||||||
|
if strings.HasPrefix(err.Error(), "template: ") {
|
||||||
|
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
|
} else {
|
||||||
ch <- gin.H{"error": err.Error()}
|
ch <- gin.H{"error": err.Error()}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if r.Stream != nil && !*r.Stream {
|
if r.Stream != nil && !*r.Stream {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user