easydel.modules.opt.modeling_opt_flax#
Flax OPT model.
- class easydel.modules.opt.modeling_opt_flax.OPTAttention(*args: Any, **kwargs: Any)[source]#
Bases:
FlaxAttentionModule
- class easydel.modules.opt.modeling_opt_flax.OPTDecoder(*args: Any, **kwargs: Any)[source]#
Bases:
EasyDeLBaseModule
- class easydel.modules.opt.modeling_opt_flax.OPTDecoderLayer(*args: Any, **kwargs: Any)[source]#
Bases:
Module
- class easydel.modules.opt.modeling_opt_flax.OPTForCausalLM(*args: Any, **kwargs: Any)[source]#
Bases:
EasyDeLBaseModule- prepare_inputs_for_generation(input_ids, max_length, attention_mask: Optional[Union[Array, ndarray, bool, number]] = None)[source]#
The prepare_inputs_for_generation function is used to prepare the inputs for a generation task.
- Parameters
self – Access variables that belong to the class
input_ids – Pass in the input tokens
max_length – Set the length of the sequence to be generated
attention_mask – tp.Optional[chex.Array]: Mask the attention weights
- Returns
A dictionary of the past_key_values, attention_mask and position ids