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

Error when loading pretrained OpenLlama model #29506

Closed
1 of 4 tasks
kevin-guimard-ext opened this issue Mar 7, 2024 · 4 comments · Fixed by #29893
Closed
1 of 4 tasks

Error when loading pretrained OpenLlama model #29506

kevin-guimard-ext opened this issue Mar 7, 2024 · 4 comments · Fixed by #29893
Labels
Good Second Issue Issues that are more difficult to do than "Good First" issues - give it a try if you want!

Comments

@kevin-guimard-ext
Copy link

kevin-guimard-ext commented Mar 7, 2024

System Info

  • transformers version: 4.38.2
  • Platform: Windows-10-10.0.19044-SP0
  • Python version: 3.10.13
  • Huggingface_hub version: 0.21.3
  • Safetensors version: 0.4.2
  • Accelerate version: 0.27.2
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.2.1+cu118 (True)
  • Tensorflow version (GPU?): 2.10.1 (True)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?: yes
  • Using distributed or parallel set-up in script?: no

Who can help?

@ArthurZucker @younesbel

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

When running this snippet:

from transformers import OpenLlamaForCausalLM
model = OpenLlamaForCausalLM.from_pretrained("openlm-research/open_llama_7b")

I get the following error:

You are using a model of type llama to instantiate a model of type open-llama. This is not supported for all configurations of models and can yield errors.
...
AttributeError: 'OpenLlamaAttention' object has no attribute 'rope_theta'

Expected behavior

The code snippet has been taken from the documentation (https://huggingface.co/docs/transformers/model_doc/open-llama), it is expected to work.

@ArthurZucker
Copy link
Collaborator

I can reproduce. This model is deprecated, feel free to open a PR for a fix, otherwise would recommend using Llama, we no longer maintain OpenLlama

@kevin-guimard-ext
Copy link
Author

Ok, I'll switch to Llama then. I wanted to try OpenLlama because I heard that Llama required a subscription, but I may be wrong.

@ArthurZucker
Copy link
Collaborator

No, OpenLlama is basically Llama but with some "optimisations". You should be able to load https://huggingface.co/NousResearch/Llama-2-7b-hf 🤫

@kevin-guimard-ext
Copy link
Author

It's a pity that the "Run the model" section has not been written for this model, with a snippet explaining how to use it. Must the weights be downloaded from the Meta repo?

@ArthurZucker ArthurZucker added the Good Second Issue Issues that are more difficult to do than "Good First" issues - give it a try if you want! label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good Second Issue Issues that are more difficult to do than "Good First" issues - give it a try if you want!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants