llama-7b-example icon indicating copy to clipboard operation
llama-7b-example copied to clipboard

Which version of transformers is it? Please download it below

Open zhangzai666 opened this issue 2 years ago • 7 comments
trafficstars

AttributeError: module transformers has no attribute LLaMATokenizer Thanks

zhangzai666 avatar Mar 15 '23 07:03 zhangzai666

Same problem here although I used the right version: pip install git+https://github.com/huggingface/transformers.git@refs/pull/21955/merge

windprak avatar Mar 15 '23 13:03 windprak

Apparently they have a typo in their code the second L should be lowercase:

tokenizer = transformers.LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
model = transformers.LlamaForCausalLM.from_pretrained("decapoda-research/llama-7b-hf").to(device)

Install this: pip install git+https://github.com/huggingface/transformers.git@refs/pull/21955/merge and pip install sentencepiece and it will work!

windprak avatar Mar 15 '23 13:03 windprak

Hmm, I don't see a case typo... also the launch.ps1 should have installed that merge and sentence piece, if it does fail you are correct:

pip install git+https://github.com/huggingface/transformers.git@refs/pull/21955/merge pip install sentencepiece

treadon avatar Mar 15 '23 13:03 treadon

Ok, I really appreciate your answer

zhangzai666 avatar Mar 16 '23 05:03 zhangzai666

Was the hugginface repo deleted? I'm getting this error:

Collecting git+https://github.com/huggingface/transformers.git@refs/pull/21955/merge
  Cloning https://github.com/huggingface/transformers.git (to revision refs/pull/21955/merge) to /tmp/pip-req-build-c5eeph2t
  Running command git clone -q https://github.com/huggingface/transformers.git /tmp/pip-req-build-c5eeph2t
  WARNING: Did not find branch or tag 'refs/pull/21955/merge', assuming revision or ref.
  Running command git fetch -q https://github.com/huggingface/transformers.git refs/pull/21955/merge
  fatal: couldn't find remote ref refs/pull/21955/merge

EDIT: I fixed it changing pip install git+https://github.com/huggingface/transformers.git@refs/pull/21955/merge into pip install git+https://github.com/huggingface/transformers.git@refs/pull/22209/merge

compadrejavo avatar Mar 16 '23 18:03 compadrejavo

issue with cloning hugging face repo getting this error need some help on this

Collecting git+https://github.com/huggingface/transformers.git@refs/pull/22209/merge Cloning https://github.com/huggingface/transformers.git (to revision refs/pull/22209/merge) to /tmp/pip-req-build-91o7xgyr Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers.git /tmp/pip-req-build-91o7xgyr WARNING: Did not find branch or tag 'refs/pull/22209/merge', assuming revision or ref. Running command git fetch -q https://github.com/huggingface/transformers.git refs/pull/22209/merge fatal: couldn't find remote ref refs/pull/22209/merge

pratiknexsol avatar Mar 24 '23 11:03 pratiknexsol

@pratiknexsol

Try this :

pip install git+https://github.com/huggingface/transformers.git

Then on src/llama.py

Then replace :

  • transformers.LLaMATokenizer -> transformers.LlamaTokenizer

  • and LLaMAForCausalLM -> LlamaForCausalLM

Does this fix your problem ?

Anvil-Late avatar Mar 27 '23 13:03 Anvil-Late