MCPcopy Create free account
hub / github.com/microsoft/BitNet / decode

Method decode

gpu/tokenizer.py:158–169  ·  view source on GitHub ↗

Decodes a list of token IDs into a string. Args: t (List[int]): The list of token IDs to be decoded. Returns: str: The decoded string.

(self, t: Sequence[int])

Source from the content-addressed store, hash-verified

156 return t
157
158 def decode(self, t: Sequence[int]) -> str:
159 """
160 Decodes a list of token IDs into a string.
161
162 Args:
163 t (List[int]): The list of token IDs to be decoded.
164
165 Returns:
166 str: The decoded string.
167 """
168 # Typecast is safe here. Tiktoken doesn't do anything list-related with the sequence.
169 return self.model.decode(cast(List[int], t))
170
171 @staticmethod
172 def _split_whitespaces_or_nonwhitespaces(

Callers 3

get_vocab_baseMethod · 0.45
decodeMethod · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected