Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BPETokenizer ¶
type BPETokenizer struct { *bpetokenizer.BPETokenizer EosTokenID int BosTokenID int PadTokenID int DecoderStartTokenID int ExtraSpecialTokenIDs map[int]string }
func (*BPETokenizer) Detokenize ¶
func (m *BPETokenizer) Detokenize(tokenIds []int, stripPaddingTokens bool) string
Detokenize returns the text of the input token IDs removing the padding token.
type SentencePieceTokenizer ¶
type SentencePieceTokenizer struct { *sentencepiece.Tokenizer EosTokenID int BosTokenID int PadTokenID int DecoderStartTokenID int }
func (*SentencePieceTokenizer) Detokenize ¶
func (m *SentencePieceTokenizer) Detokenize(tokenIds []int, stripPaddingTokens bool) string
Detokenize returns the text of the input token IDs removing the padding token.
type Text2Text ¶
type Text2Text struct { // Model is the model used for conditional generation. Model *bart.ModelForConditionalGeneration // Tokenizer is the tokenizer used for conditional generation. Tokenizer Tokenizer // contains filtered or unexported fields }
Text2Text contains the ModelForConditionalGeneration and the Tokenizer used for conditional generation tasks. For example, Machine Translation and Summarization.
func LoadText2Text ¶
LoadText2Text returns a Text2Text loading the model, the embeddings and the tokenizer from a directory.
Click to show internal directories.
Click to hide internal directories.