LLaMA-Factory icon indicating copy to clipboard operation
LLaMA-Factory copied to clipboard

加载llama3 70B模型时, AutoTokenizer 报错

Open ArcherShirou opened this issue 10 months ago • 1 comments

Reminder

  • [X] I have read the README and searched the existing issues.

Reproduction

image 请问如何解决

Expected behavior

No response

System Info

No response

Others

No response

ArcherShirou avatar Apr 19 '24 09:04 ArcherShirou

报错信息不全

hiyouga avatar Apr 19 '24 11:04 hiyouga

您好,以下是完整的报错信息: image tokenizers 0.19.1 torch 2.2.2 transformers 4.40.0 加载 vllm 推理时: export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 API_PORT=8000 python src/api_demo.py
--model_name_or_path Meta-Llama-3-70B-Instruct
--template llama3
--infer_backend vllm
--vllm_enforce_eager 出现相同的错误: image

ArcherShirou avatar Apr 19 '24 14:04 ArcherShirou

模型文件不全

hiyouga avatar Apr 19 '24 14:04 hiyouga

您好,模型文件没有缺失,用官方的vllm可以推理: image

ArcherShirou avatar Apr 19 '24 17:04 ArcherShirou

更新llamafactory代码

hiyouga avatar Apr 19 '24 17:04 hiyouga

找到真正的问题所在了,是官方上传的模型文件不全,缺少tokenizer_config.json文件,需要把llama-8b-instruct中的tokenizer_config.json复制到llama-70b-instruct中,就可以解决tokenizer报错的问题

ArcherShirou avatar Apr 22 '24 09:04 ArcherShirou

找到真正的问题所在了,是官方上传的模型文件不全,缺少tokenizer_config.json文件,需要把llama-8b-instruct中的tokenizer_config.json复制到llama-70b-instruct中,就可以解决tokenizer报错的问题

不需要这么做,更新transformers库到4.41.0就可以

luolanfeixue avatar May 11 '24 02:05 luolanfeixue

LlamaTokenizer.from_pretrained(model_name_or_path,**tokenizer_kwargs) 改为 AutoTokenizer.from_pretrained(model_name_or_path,**tokenizer_kwargs)

luolanfeixue avatar May 15 '24 03:05 luolanfeixue