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])
| 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( |
no outgoing calls
no test coverage detected