MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / check_config

Method check_config

tensorrt_llm/models/enc_dec/model.py:691–714  ·  view source on GitHub ↗
(self, config: PretrainedConfig)

Source from the content-addressed store, hash-verified

689 self.transformer.assign_module(encoder_layers, "layers")
690
691 def check_config(self, config: PretrainedConfig):
692 config.set_if_not_exist('has_position_embedding', False)
693 config.set_if_not_exist('type_vocab_size', None)
694 config.set_if_not_exist('rescale_before_lm_head', False)
695 config.set_if_not_exist('layernorm_type', LayerNormType.LayerNorm)
696 config.set_if_not_exist('layernorm_position',
697 LayerNormPositionType.pre_layernorm)
698 config.set_if_not_exist('has_attention_qkvo_bias', False)
699 config.set_if_not_exist('has_mlp_bias', False)
700 config.set_if_not_exist('has_model_final_layernorm', False)
701 config.set_if_not_exist('encoder_hidden_size', None)
702 config.set_if_not_exist('encoder_num_heads', None)
703 config.set_if_not_exist('encoder_num_kv_heads', None)
704 config.set_if_not_exist('encoder_head_size', None)
705 config.set_if_not_exist('model_type', 't5')
706 config.set_if_not_exist('skip_cross_kv', False)
707 config.set_if_not_exist('mlp_type', MLPType.MLP)
708 config.set_if_not_exist('has_embedding_scale', False)
709 config.set_if_not_exist('residual_scaling', 1.0)
710 config.set_if_not_exist('has_lm_head_bias', False)
711 config.set_if_not_exist('num_buckets', None)
712 config.set_if_not_exist('max_distance', None)
713 config.set_if_not_exist('relative_attention', False)
714 config.set_if_not_exist('residual_scaling', 1.0)
715
716 def forward(self,
717 input_ids: Tensor,

Callers 1

__init__Method · 0.95

Calls 1

set_if_not_existMethod · 0.80

Tested by

no test coverage detected