runner.go: Don't decode if nothing has been added to the batch

If nothing has been added to a batch then decoding will fail if
attempted. This can happen, for example, if the run loop is woken
up but we realize that we have the generation limit.
This commit is contained in:
Jesse Gross 2024-08-14 10:32:05 -07:00 committed by jmorganca
parent 8aa97b5e83
commit 5a441d227a

View File

@ -184,6 +184,10 @@ func (s *Server) run(ctx context.Context) {
seq.iBatch = batch.NumTokens() - 1
}
if batch.NumTokens() == 0 {
continue
}
err := s.lc.Decode(batch)
if err != nil {
slog.Error("failed to decode batch", "error", err)