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

Method __init__

tensorrt_llm/models/commandr/model.py:154–170  ·  view source on GitHub ↗
(self, config: CohereConfig)

Source from the content-addressed store, hash-verified

152 config_class = CohereConfig
153
154 def __init__(self, config: CohereConfig):
155 transformer = CohereModel(config)
156 vocab_size_padded = pad_vocab_size(config.vocab_size,
157 config.mapping.tp_size)
158 if config.mapping.is_last_pp_rank():
159 lm_head = ColumnLinear(config.hidden_size,
160 vocab_size_padded,
161 bias=False,
162 dtype=config.dtype,
163 tp_group=config.mapping.tp_group,
164 tp_size=config.mapping.tp_size,
165 gather_output=True)
166 else:
167 lm_head = None
168 self.quant_mode = config.quant_mode
169 self.mapping = config.mapping
170 super().__init__(config, transformer, lm_head)
171
172 @classmethod
173 def from_hugging_face(cls,

Callers

nothing calls this directly

Calls 4

CohereModelClass · 0.85
pad_vocab_sizeFunction · 0.85
is_last_pp_rankMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected