From 80f53f7380c7072263ea3af460a0464017a81e03 Mon Sep 17 00:00:00 2001 From: thomwolf Date: Tue, 30 Apr 2019 11:10:22 +0200 Subject: [PATCH] gpt-2 from_pretrained can use special tokens --- pytorch_pretrained_bert/modeling_gpt2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_pretrained_bert/modeling_gpt2.py b/pytorch_pretrained_bert/modeling_gpt2.py index 5537f93f66..37c5a2d9fb 100644 --- a/pytorch_pretrained_bert/modeling_gpt2.py +++ b/pytorch_pretrained_bert/modeling_gpt2.py @@ -371,7 +371,7 @@ class GPT2PreTrainedModel(nn.Module): @classmethod def from_pretrained( - cls, pretrained_model_name_or_path, state_dict=None, cache_dir=None, from_tf=False, *inputs, **kwargs + cls, pretrained_model_name_or_path, num_special_tokens=None, state_dict=None, cache_dir=None, from_tf=False, *inputs, **kwargs ): """ Instantiate a GPT2PreTrainedModel from a pre-trained model file or a pytorch state dict.