Skip to content
New issue

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

XLNetLMHeadModel has no attribute 'from_config' #14736

Closed
2 tasks done
josutk opened this issue Dec 12, 2021 · 2 comments · Fixed by #14746
Closed
2 tasks done

XLNetLMHeadModel has no attribute 'from_config' #14736

josutk opened this issue Dec 12, 2021 · 2 comments · Fixed by #14746

Comments

@josutk
Copy link
Contributor

josutk commented Dec 12, 2021

Environment info

  • transformers version: 4.8.0
  • Platform: Linux-4.15.0-20-generic-x86_64-with-LinuxMint-19-tara
  • Python version: 3.6.9
  • PyTorch version (GPU?): 1.8.0+cu111 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?: yes

Who can help

@patrickvonplaten

Information

Model I am trying to train a XLNet model from scratch to portuguese but when i run this script: https://github.com/huggingface/transformers/blob/v4.8.2-release/examples/pytorch/language-modeling/run_plm.py i get this error:

Traceback (most recent call last):
File "run_plm.py", line 498, in
main()
File "run_plm.py", line 330, in main
model = XLNetLMHeadModel.from_config(config)
AttributeError: type object 'XLNetLMHeadModel' has no attribute 'from_config'

The problem arises when using:

  • the official example scripts: (give details below)

The tasks I am working on is:

  • my own task or dataset: (give details below)
    portuguese wikipedia dataset
@patrickvonplaten
Copy link
Contributor

Good catch @josutk,

I think we should change this line to:

model = XLNetLMHeadModel(config)

would you like to open a PR for this? :-)

@josutk
Copy link
Contributor Author

josutk commented Dec 13, 2021

@patrickvonplaten I have open PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants