MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / SharedEmbedding

Class SharedEmbedding

inference/models/mpt.py:88–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87
88class SharedEmbedding(nn.Embedding):
89 def forward(self, input: torch.Tensor, unembed: bool = False) -> torch.Tensor:
90 if unembed:
91 return F.linear(input, self.weight)
92 return super().forward(input)
93
94
95class MPTAttentionFused(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected