modernize

This commit is contained in:
Michael Yang
2025-11-16 12:49:48 -08:00
parent d70e935526
commit efd9f5e67e
31 changed files with 75 additions and 107 deletions

View File

@@ -577,10 +577,7 @@ func (s *Server) processBatch(tokenBatch *llama.Batch, embedBatch *llama.Batch)
if seq.logprobs {
origLogprobsLen := len(seq.pendingLogprobs)
numTokensRemoved := origLen - newLen
newLogprobsLen := origLogprobsLen - numTokensRemoved
if newLogprobsLen < 0 {
newLogprobsLen = 0
}
newLogprobsLen := max(origLogprobsLen-numTokensRemoved, 0)
seq.pendingLogprobs = seq.pendingLogprobs[:newLogprobsLen]
}