Skip to content

Commit 8499b3d

Browse files
committed
fix: ensure context size from model configuration is positive before using it
1 parent 24a1710 commit 8499b3d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/inference/backends/vllm/vllm_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func GetMaxModelLen(modelCfg types.ModelConfig, backendCfg *inference.BackendCon
9797
}
9898
// Fallback to model config (set at packaging time via docker model package --context-size)
9999
if modelCfg != nil {
100-
if ctxSize := modelCfg.GetContextSize(); ctxSize != nil {
100+
if ctxSize := modelCfg.GetContextSize(); ctxSize != nil && *ctxSize > 0 {
101101
return ctxSize
102102
}
103103
}

0 commit comments

Comments
 (0)