llm: raise token repeat limit to 100 and return error instead of silently closing (#18374)

This commit is contained in:
frob 2026-09-11 00:46:58 +02:00 • committed by GitHub
parent f09d55d0e2
commit 4512d2b76d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1700,9 +1700,9 @@ func (s *llamaServerRunner) Completion(ctx context.Context, req CompletionReques
lastToken = strings.TrimSpace(lsResp.Content)
tokenRepeat = 0
}
if tokenRepeat > 30 {
if tokenRepeat > 100 {
slog.Debug("prediction aborted, token repeat limit reached")
return ctx.Err()
return fmt.Errorf("prediction aborted, token repeat limit reached")
}
if lsResp.Content != "" && !lsResp.Stop {