SentencePieceDecoder

final class fairseq2.data.text.SentencePieceDecoder(model, reverse=False)[source]

Bases: TextTokenDecoder

__call__(token_indices)[source]
Parameters:

token_indices (Tensor) – The token indices to decode from.

Return type:

str | CString

decode_from_tokens(tokens)[source]
Parameters:

tokens (Sequence[str | CString]) – The tokens to decode from.

Return type:

str | CString