No parameter which is presented in documentation
Documentation web page: https://huggingface.co/pytorch-transformers/model_doc/gpt2.html#pytorch_transformers.GPT2Model
See `Inputs -> attention_mask`.

There is actually no parameter `attention_mask` in `GPT2Model.forward` method (see https://github.com/huggingface/pytorch-transformers/blob/master/pytorch_transformers/modeling_gpt2.py#L473)

Of course trying to provide `attention_mask` parameter to model raises an exception:
> TypeError: forward() got an unexpected keyword argument 'attention_mask'

Please either add parameter `attention_mask` to `GPT2Model.forward` or delete it from documentation.

Same for https://huggingface.co/pytorch-transformers/model_doc/gpt2.html#pytorch_transformers.GPT2LMHeadModel
and for
https://huggingface.co/pytorch-transformers/model_doc/gpt2.html#pytorch_transformers.GPT2DoubleHeadsModel

I've created #1116 in case you want just delete it from documentation.
Indeed, thanks for that!<|||||>Sorry, but I still get this error, and I can see the parameter on the forward functions at the source code. Am I doing something wrong ?

Thanks for this amazing contribution!<|||||>Can you open a new issue with details on the error?
`attention_mask` has been added to GPT2 now so it's not the same situation.<|||||>Sorry, my problem was that there was no attention_mask parameter on the forward function, but I can see it now. Thanks