MCPcopy Create free account
hub / github.com/FreedomIntelligence/CMB / forward

Method forward

workers/chatglm3_modeling.py:84–90  ·  view source on GitHub ↗
(self, prefix: torch.Tensor)

Source from the content-addressed store, hash-verified

82 config.num_layers * config.kv_channels * config.multi_query_group_num * 2)
83
84 def forward(self, prefix: torch.Tensor):
85 if self.prefix_projection:
86 prefix_tokens = self.embedding(prefix)
87 past_key_values = self.trans(prefix_tokens)
88 else:
89 past_key_values = self.embedding(prefix)
90 return past_key_values
91
92
93def split_tensor_along_last_dim(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected