fix(llama.cpp): set -1 as default for max tokens (#2087)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-04-20 20:20:10 +02:00 committed by GitHub
parent 03adc1f60d
commit afa1bca1e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -205,15 +205,15 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
defaultTopP := 0.95
defaultTopK := 40
defaultTemp := 0.9
defaultMaxTokens := 2048
defaultMirostat := 2
defaultMirostatTAU := 5.0
defaultMirostatETA := 0.1
defaultTypicalP := 1.0
defaultTFZ := 1.0
defaultInfinity := -1
// Try to offload all GPU layers (if GPU is found)
defaultNGPULayers := 99999999
defaultHigh := 99999999
trueV := true
falseV := false
@ -254,7 +254,7 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
}
if cfg.Maxtokens == nil {
cfg.Maxtokens = &defaultMaxTokens
cfg.Maxtokens = &defaultInfinity
}
if cfg.Mirostat == nil {
@ -269,7 +269,7 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
cfg.MirostatTAU = &defaultMirostatTAU
}
if cfg.NGPULayers == nil {
cfg.NGPULayers = &defaultNGPULayers
cfg.NGPULayers = &defaultHigh
}
if cfg.LowVRAM == nil {