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

Method forward

train/patch/modeling_chatglm.py:632–641  ·  view source on GitHub ↗
(self, input_ids)

Source from the content-addressed store, hash-verified

630 self.fp32_residual_connection = config.fp32_residual_connection
631
632 def forward(self, input_ids):
633 # Embeddings.
634 words_embeddings = self.word_embeddings(input_ids)
635 embeddings = words_embeddings
636 # Data format change to avoid explicit tranposes : [b s h] --> [s b h].
637 embeddings = embeddings.transpose(0, 1).contiguous()
638 # If the input flag for fp32 residual connection is set, convert for float.
639 if self.fp32_residual_connection:
640 embeddings = embeddings.float()
641 return embeddings
642
643
644class ChatGLMModel(ChatGLMPreTrainedModel):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected