runner.go: Fix off-by-one for num predicted

This commit is contained in:
Jesse Gross 2024-11-12 10:41:44 -08:00 committed by Jesse Gross
parent 636a743c2b
commit d7eb05b936

View file

@ -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
}