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

decode_from_tokens(tokens)[source]
Parameters:

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

Return type:

str