(self, tokens: List[int])
| 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 = [] |