Move the parser back + handle utf16 files (#4533)

This commit is contained in:
Patrick Devine
2024-05-20 11:26:45 -07:00
committed by GitHub
parent 63a453554d
commit ccdf0b2a44
6 changed files with 84 additions and 17 deletions

View File

@@ -29,6 +29,7 @@ import (
"github.com/ollama/ollama/gpu"
"github.com/ollama/ollama/llm"
"github.com/ollama/ollama/openai"
"github.com/ollama/ollama/parser"
"github.com/ollama/ollama/server/envconfig"
"github.com/ollama/ollama/types/errtypes"
"github.com/ollama/ollama/types/model"
@@ -539,7 +540,7 @@ func (s *Server) CreateModelHandler(c *gin.Context) {
r = f
}
modelfile, err := model.ParseFile(r)
modelfile, err := parser.ParseFile(r)
if err != nil {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return