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

Method token_bytes_with_prev

examples/server/server.py:12065–12068  ·  view source on GitHub ↗
(self, prev_tokens: Sequence[int], token: int)

Source from the content-addressed store, hash-verified

12063 return self.detokenize([token])
12064
12065 def token_bytes_with_prev(self, prev_tokens: Sequence[int], token: int) -> bytes:
12066 current = self.detokenize([*prev_tokens, token])
12067 previous = self.detokenize(prev_tokens)
12068 return current[len(previous) :]
12069
12070 def token_bytes_with_prev_bytes(
12071 self,

Callers 3

from_tokenMethod · 0.80
from_logitsMethod · 0.80

Calls 1

detokenizeMethod · 0.95

Tested by

no test coverage detected