localGPT
localGPT copied to clipboard
Cannot import name 'LlamaTokenizer'
Excuse me, I'm a newbie and I'm trying to use LocalGPT but I have this problem. A thousand thanks!
(base) Armando@iMac-di-Martina ~ % python Documents/LocalGPT/run_localGPT.py
Traceback (most recent call last):
File "/Users/Armando/Documents/LocalGPT/run_localGPT.py", line 7, in
@armbis can you please show your code, it is difficult trying to understand what is happening.
armbis
Try uninstalling and then installing "transformers": pip uninstall transformers pip install transformers conda update transformers
I was personally able to resolve this error by running localGPT outside of conda. If you are running it inside conda, I believe you need to ensure the pip -r install requirements and transformers are installed on the conda environment.
If you still having problems with from transformers import LlamaForCausalLM, LlamaTokenizer try to install the package directly from github:
pip install git+https://github.com/huggingface/transformers
also don't forget to change the Tokenizer config file from LLaMATokenizer to LlamaTokenizer.
source: https://github.com/huggingface/transformers/issues/22222 closes #54