Skip to content

Commit

Permalink
fix(llama.cpp): set -1 as default for max tokens (#2087)
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Apr 20, 2024
1 parent 03adc1f commit afa1bca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/config/backend_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -254,7 +254,7 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
}

if cfg.Maxtokens == nil {
cfg.Maxtokens = &defaultMaxTokens
cfg.Maxtokens = &defaultInfinity
}

if cfg.Mirostat == nil {
Expand All @@ -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 {
Expand Down

0 comments on commit afa1bca

Please sign in to comment.