llama: update vendored code to commit 46e3556 (#8308)

This commit is contained in:
Jeffrey Morgan 2025-01-08 11:22:01 -08:00 committed by GitHub
parent 57f038ec7b
commit 1deafd8254
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
305 changed files with 16048 additions and 12926 deletions

View file

@ -11,6 +11,7 @@ import (
"os"
"os/user"
"path/filepath"
"slices"
"strconv"
"strings"
@ -35,6 +36,8 @@ func (f Modelfile) String() string {
return sb.String()
}
var deprecatedParameters = []string{"penalize_newline"}
// CreateRequest creates a new *api.CreateRequest from an existing Modelfile
func (f Modelfile) CreateRequest() (*api.CreateRequest, error) {
req := &api.CreateRequest{}
@ -82,6 +85,11 @@ func (f Modelfile) CreateRequest() (*api.CreateRequest, error) {
role, msg, _ := strings.Cut(c.Args, ": ")
messages = append(messages, api.Message{Role: role, Content: msg})
default:
if slices.Contains(deprecatedParameters, c.Name) {
fmt.Printf("warning: parameter %s is deprecated\n", c.Name)
break
}
ps, err := api.FormatParams(map[string][]string{c.Name: {c.Args}})
if err != nil {
return nil, err