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])
| 173 | return t |
| 174 | |
| 175 | def decode(self, t: Sequence[int]) -> str: |
| 176 | """ |
| 177 | Decodes a list of token IDs into a string. |
| 178 | |
| 179 | Args: |
| 180 | t (List[int]): The list of token IDs to be decoded. |
| 181 | |
| 182 | Returns: |
| 183 | str: The decoded string. |
| 184 | """ |
| 185 | # Typecast is safe here. Tiktoken doesn't do anything list-related with the sequence. |
| 186 | return self.model.decode(cast(List[int], t)) |
| 187 | |
| 188 | def decode_token(self, t: int) -> str: |
| 189 | """ |
no outgoing calls