I recently fine-tuned a GPT model (GPT2LMHeadModel) and tried to push it to hub. I followed the tutorial but got this strange error: ‘GPT2LMHeadModel’ object has no attribute ‘push_to_hub’
I’ve updated the transformers library to the latest version, as shown in the screenshot. Can anybody help me with that? I’ve been working on this problem for 3 hours but still in vain…
Using the push_to_hub method is preferred when you just want to push to the Hub, and your model should have that method. Are you absolutely certain the Transformers version is correct inside your notebook? All PreTrainedModel have the push_to_hub method.
in the notebook to make sure the version is correct. You can see my screenshot that the library version is correct.
Something strange is that I used
dir(my_gpt_model)
to print out all the methods and attributes in the object but there’s no push_to_hub method. I even tried to use the save_pretrained method with the ‘push_to_hub’ set to true but it gives me an error saying no such parameter for the method.
It seems that even though pip updated the transformers library, some files in the library remained not updated. I really don’t understand how this happened…