Skip to content

Commit bfd8e09

Browse files
authored
Merge pull request huggingface#49 from sgugger/patch-1
Use the embedding dropout
2 parents d848a49 + 1ea4259 commit bfd8e09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def __init__(self, cfg, vocab=40990, n_ctx=512):
166166

167167
def forward(self, x):
168168
x = x.view(-1, x.size(-2), x.size(-1))
169-
e = self.embed(x)
169+
e = self.drop(self.embed(x))
170170
# Add the position information to the input embeddings
171171
h = e.sum(dim=2)
172172
for block in self.h:

0 commit comments

Comments
 (0)