MCPcopy Create free account
hub / github.com/THUDM/LongWriter / __init__

Method __init__

train/patch/modeling_chatglm.py:619–630  ·  view source on GitHub ↗
(self, config: ChatGLMConfig, device=None)

Source from the content-addressed store, hash-verified

617 """Language model embeddings."""
618
619 def __init__(self, config: ChatGLMConfig, device=None):
620 super(Embedding, self).__init__()
621
622 self.hidden_size = config.hidden_size
623 # Word embeddings (parallel).
624 self.word_embeddings = nn.Embedding(
625 config.padded_vocab_size,
626 self.hidden_size,
627 dtype=config.torch_dtype,
628 device=device
629 )
630 self.fp32_residual_connection = config.fp32_residual_connection
631
632 def forward(self, input_ids):
633 # Embeddings.

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected