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

Method decode

gpu/tokenizer.py:202–207  ·  view source on GitHub ↗
(self, tokens: List[int])

Source from the content-addressed store, hash-verified

200 self.eot_id = tokenizer.special_tokens["<|eot_id|>"]
201
202 def decode(self, tokens: List[int]) -> str:
203 # Decode the tokens to a string.
204 decoded_str = self.tokenizer.decode(tokens)
205 # Remove the special tokens from the decoded string.
206 decoded_str = decoded_str.replace("<|eot_id|>", "")
207 return decoded_str
208
209 def encode_header(self, message: Message) -> List[int]:
210 tokens = []

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected