MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / __init__

Method __init__

codegeex/mindspore/src/pangu_alpha.py:474–486  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

472 """
473
474 def __init__(self, config):
475 super(PanguAlphaModel, self).__init__()
476 # Network head to get logits over vocabulary
477 copied_parallel_config = copy.deepcopy(config.parallel_config)
478 if copied_parallel_config.pipeline_stage > 1:
479 copied_parallel_config.vocab_emb_dp = False
480 self.head = PanGuHead(
481 hidden_size=config.hidden_size,
482 parallel_config=copied_parallel_config,
483 )
484 self.head.pipeline_stage = config.parallel_config.pipeline_stage - 1
485 self.backbone = PanguAlpha_Model(config)
486 self.backbone.embedding.word_embedding.embedding_table.add_pipeline_stage(self.head.pipeline_stage)
487
488 def construct(self, input_ids, input_position, attention_mask,
489 init_reset=True, batch_valid_length=None):

Callers

nothing calls this directly

Calls 3

PanGuHeadClass · 0.70
PanguAlpha_ModelClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected