Skip to content

Commit 180cd4c

Browse files
authored
fix(llama.cpp-ggml): fixup max_tokens for old backend (#2094)
fix(llama.cpp-ggml): set 0 as default for `max_tokens` Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 284ad02 commit 180cd4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/config/backend_config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
210210
defaultMirostatETA := 0.1
211211
defaultTypicalP := 1.0
212212
defaultTFZ := 1.0
213-
defaultInfinity := -1
213+
defaultZero := 0
214214

215215
// Try to offload all GPU layers (if GPU is found)
216216
defaultHigh := 99999999
@@ -254,7 +254,7 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
254254
}
255255

256256
if cfg.Maxtokens == nil {
257-
cfg.Maxtokens = &defaultInfinity
257+
cfg.Maxtokens = &defaultZero
258258
}
259259

260260
if cfg.Mirostat == nil {

0 commit comments

Comments
 (0)