MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / accept

Method accept

examples/server/server.py:2370–2379  ·  view source on GitHub ↗
(self, seq_id: int, accepted_draft_tokens: int)

Source from the content-addressed store, hash-verified

2368 return results
2369
2370 def accept(self, seq_id: int, accepted_draft_tokens: int) -> None:
2371 if seq_id < 0 or seq_id >= self.n_seq_max:
2372 return
2373 n_rows = self.verify_h_rows[seq_id]
2374 if n_rows <= 0:
2375 return
2376 row = min(max(accepted_draft_tokens, 0), n_rows - 1)
2377 self.pending_h[seq_id] = self.verify_h[seq_id][row]
2378 self.ready[seq_id] = True
2379 self.ready_pos[seq_id] = self.verify_h_pos[seq_id][row] + 1
2380
2381 def _truncate_memory(self, seq_id: int, keep_len: int) -> None:
2382 if seq_id < 0 or seq_id >= self.n_seq_max:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected