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

Method token_bytes

examples/server/server.py:12062–12063  ·  view source on GitHub ↗
(self, token: int)

Source from the content-addressed store, hash-verified

12060 capacity = max(capacity * 2, -count)
12061
12062 def token_bytes(self, token: int) -> bytes:
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])

Callers 1

from_logitsMethod · 0.80

Calls 1

detokenizeMethod · 0.95

Tested by

no test coverage detected