Skip to content

Commit

Permalink
runner.go: Fix off-by-one for num predicted
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegross committed Nov 12, 2024
1 parent 636a743 commit d7eb05b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llama/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func (s *Server) processBatch(tokenBatch *llama.Batch, embedBatch *llama.Batch)
}

// if past the num predict limit
if seq.numPredict > 0 && seq.numPredicted > seq.numPredict {
if seq.numPredict > 0 && seq.numPredicted >= seq.numPredict {
s.removeSequence(seqIdx, "limit")
continue
}
Expand Down

0 comments on commit d7eb05b

Please sign in to comment.