Fix typo in GPT2Model code sample

Typo prevented code from running
This commit is contained in:
sam-qordoba
2019-02-18 09:27:26 -08:00
committed by GitHub
parent a25d056b7a
commit 1cb9c76ec5

View File

@@ -428,7 +428,7 @@ with torch.no_grad():
hidden_states_1, past = model(tokens_tensor_1)
# past can be used to reuse precomputed hidden state in a subsequent predictions
# (see beam-search examples in the run_gpt2.py example
hidden_states-2, past = model(tokens_tensor_2, past=past)
hidden_states_2, past = model(tokens_tensor_2, past=past)
```
And how to use `GPT2LMHeadModel`