Documentation
¶
Index ¶
- type Model
- func (m *Model) Close()
- func (m *Model) Decode(encodedInput []ag.Node, inputIDs []int, pastCache generation.Cache) (ag.Node, generation.Cache)
- func (m *Model) Encode(InputIDs []int) []ag.Node
- func (m *Model) Generate(inputIDs []int) []int
- func (m *Model) PredictNext(encoderOutLastHiddenState []ag.Node, decoderInputIDs []int, ...) (ag.Node, decoder.KeysValuesPairs)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
Model is a model for conditional generation tasks which embeds a BART pre-trained model.
func (*Model) Decode ¶
func (m *Model) Decode(encodedInput []ag.Node, inputIDs []int, pastCache generation.Cache) (ag.Node, generation.Cache)
Decode satisfies pkg/nlp/transformers/generation/Decoder.
func (*Model) PredictNext ¶
func (m *Model) PredictNext( encoderOutLastHiddenState []ag.Node, decoderInputIDs []int, pastKeyValues decoder.KeysValuesPairs, ) (ag.Node, decoder.KeysValuesPairs)
PredictNext returns the logits for the next possible tokens.
Click to show internal directories.
Click to hide internal directories.