mirror of
https://github.com/ollama/ollama.git
synced 2026-10-22 03:22:02 +00:00
llm: raise token repeat limit to 100 and return error instead of silently closing (#18374)
This commit is contained in:
parent
f09d55d0e2
commit
4512d2b76d
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue