We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transformers
@patrickvonplaten, @LysandreJik
Model I am using: GPT-2
The problem arises when using:
Steps to reproduce the behavior:
from transformers import AutoConfig, AutoModelForCausalLM, GPT2LMHeadModel config = AutoConfig.from_pretrained("gpt2", return_dict=True, gradient_checkpointing=False) model_class = GPT2LMHeadModel model = model_class(config) # WORKS FINE model_class = AutoModelForCausalLM model = model_class(config) # FAILS, stack trace below Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: __init__() takes 1 positional argument but 2 were given
Both cases should work fine. The latter case should pull the former class internally.
The text was updated successfully, but these errors were encountered:
Hello! We recommend you read the docs regarding the AutoModel. I have linked you the from_config method which should be used in this use case.
AutoModel
from_config
Sorry, something went wrong.
However, it is indeed unexpected for you to receive this error message. The message should be more explicit, investigating now.
Opened #11956 for a more explicit error, and opening your use case for discussion.
No branches or pull requests
Environment info
transformers
version: 4.5.1Who can help
@patrickvonplaten, @LysandreJik
Information
Model I am using: GPT-2
The problem arises when using:
To reproduce
Steps to reproduce the behavior:
Expected behavior
Both cases should work fine. The latter case should pull the former class internally.
The text was updated successfully, but these errors were encountered: