Class: Informers::MBartForCausalLM
- Inherits:
-
MBartPreTrainedModel
- Object
- PreTrainedModel
- MBartPreTrainedModel
- Informers::MBartForCausalLM
- Defined in:
- lib/informers/models.rb
Constant Summary
Constants inherited from PreTrainedModel
PreTrainedModel::MAIN_INPUT_NAME
Instance Attribute Summary collapse
-
#decoder_dim_kv ⇒ Object
readonly
Returns the value of attribute decoder_dim_kv.
-
#encoder_dim_kv ⇒ Object
readonly
Returns the value of attribute encoder_dim_kv.
-
#num_decoder_heads ⇒ Object
readonly
Returns the value of attribute num_decoder_heads.
-
#num_decoder_layers ⇒ Object
readonly
Returns the value of attribute num_decoder_layers.
-
#num_encoder_heads ⇒ Object
readonly
Returns the value of attribute num_encoder_heads.
-
#num_encoder_layers ⇒ Object
readonly
Returns the value of attribute num_encoder_layers.
Attributes inherited from PreTrainedModel
Instance Method Summary collapse
-
#initialize(config, decoder_merged_session, generation_config) ⇒ MBartForCausalLM
constructor
A new instance of MBartForCausalLM.
Methods inherited from PreTrainedModel
#call, construct_session, from_pretrained, #generate
Constructor Details
#initialize(config, decoder_merged_session, generation_config) ⇒ MBartForCausalLM
Returns a new instance of MBartForCausalLM.
882 883 884 885 886 887 888 889 890 891 892 893 |
# File 'lib/informers/models.rb', line 882 def initialize(config, decoder_merged_session, generation_config) super(config, decoder_merged_session) @generation_config = generation_config @num_decoder_layers = @config["decoder_layers"] @num_decoder_heads = @config["decoder_attention_heads"] @decoder_dim_kv = @config["d_model"] / @num_decoder_heads.to_f @num_encoder_layers = @config["encoder_layers"] @num_encoder_heads = @config["encoder_attention_heads"] @encoder_dim_kv = @config["d_model"] / @num_encoder_heads.to_f end |
Instance Attribute Details
#decoder_dim_kv ⇒ Object (readonly)
Returns the value of attribute decoder_dim_kv.
879 880 881 |
# File 'lib/informers/models.rb', line 879 def decoder_dim_kv @decoder_dim_kv end |
#encoder_dim_kv ⇒ Object (readonly)
Returns the value of attribute encoder_dim_kv.
879 880 881 |
# File 'lib/informers/models.rb', line 879 def encoder_dim_kv @encoder_dim_kv end |
#num_decoder_heads ⇒ Object (readonly)
Returns the value of attribute num_decoder_heads.
879 880 881 |
# File 'lib/informers/models.rb', line 879 def num_decoder_heads @num_decoder_heads end |
#num_decoder_layers ⇒ Object (readonly)
Returns the value of attribute num_decoder_layers.
879 880 881 |
# File 'lib/informers/models.rb', line 879 def num_decoder_layers @num_decoder_layers end |
#num_encoder_heads ⇒ Object (readonly)
Returns the value of attribute num_encoder_heads.
879 880 881 |
# File 'lib/informers/models.rb', line 879 def num_encoder_heads @num_encoder_heads end |
#num_encoder_layers ⇒ Object (readonly)
Returns the value of attribute num_encoder_layers.
879 880 881 |
# File 'lib/informers/models.rb', line 879 def num_encoder_layers @num_encoder_layers end |