project-baize / baize-chatbot

Let ChatGPT teach your own chatbot in hours with a single GPU!
https://arxiv.org/abs/2304.01196
GNU General Public License v3.0
3.15k stars 275 forks source link

Encountering error: app.py has "cannot import name 'LlamaForCausalLM' from 'transformers'" #10

Open koolkao opened 1 year ago

koolkao commented 1 year ago

New to the world of LLMs. I've been playing with the Baize Huggingface demo--it gives great responses!

I'd like to install it on my machine but after a clean install with successful pip install, app.py gives this error: cannot import name 'LlamaForCausalLM' from 'transformers'

Any guidance is appreciated, thank you!

guoday commented 1 year ago

please update your transformers

koolkao commented 1 year ago

Thank you! I believe I have successfully installed transformers via this line in requirements.txt: git+https://github.com/huggingface/transformers.git However a search of that Huggingface repository finds no mention ofLlamaForCausalLM

Is there somewhere else I should go to update transformers?

thank you

JetRunner commented 1 year ago

Simply

pip uninstall transformers
pip install transformers
koolkao commented 1 year ago

thank you I appreciate your response. I uninstalled/installed several times to the latest version 4.27.4, and unfortunately still getting the same error

JetRunner commented 1 year ago

You can try install from source! Following this page: https://huggingface.co/docs/transformers/installation#installing-from-source or try pip install git+https://github.com/huggingface/transformers.git

JetRunner commented 1 year ago

However a search of that Huggingface repository finds no mention of LlamaForCausalLM

https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/modeling_llama.py