Jesse Gross пре 8 месеци
родитељ
комит
c8a1741d9b
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      llama/runner/runner.go

+ 2 - 2
llama/runner/runner.go

@@ -176,6 +176,8 @@ func (s *Server) shiftContext(seqIndex int) {
 	slog.Debug("context limit hit - shifting", "limit", s.numCtx, "nPast", seq.nPast,
 		"numKeep", seq.numKeep, "numLeft", numLeft, "numDiscard", numDiscard)
 
+	// TODO (jessegross): KV cache removal can fail for certain types of models
+	// server.cpp doesn't handle this, though we can be more graceful
 	s.lc.KvCacheSeqRm(seqIndex, seq.numKeep, seq.numKeep+numDiscard)
 	s.lc.KvCacheSeqAdd(seqIndex, seq.numKeep+numDiscard, seq.nPast, -numDiscard)
 
@@ -327,13 +329,11 @@ func (s *Server) processBatch() {
 		slog.Debug("sampled", "piece", piece)
 
 		// if it's an end of sequence token, break
-		// TODO: just end this sequence
 		if s.model.TokenIsEog(token) {
 			// TODO (jmorganca): we should send this back
 			// as it's important for the /api/generate context
 			// seq.responses <- piece
 
-			// TODO: end the sequence instead of quitting the pool
 			s.removeSequence(i, "stop")
 			continue
 		}