mirror of
https://github.com/wassname/openai-transformer-lm-gutenberg-erotic.git
synced 2026-06-27 16:10:19 +08:00
Solving missing variable issue.
This commit is contained in:
@@ -177,6 +177,7 @@ class LMHead(nn.Module):
|
||||
def __init__(self, model, cfg):
|
||||
super(LMHead, self).__init__()
|
||||
self.n_embd = cfg.n_embd
|
||||
embed_shape = model.embed.weight.shape
|
||||
self.decoder = nn.Linear(embed_shape[1], embed_shape[0], bias=False)
|
||||
self.decoder.weight = model.embed.weight # Tied weights
|
||||
|
||||
|
||||
Reference in New Issue
Block a user