Closed dongziyu1016 closed 7 months ago
信息太少。什么模型、从哪里下载的?运行的什么命令?llama.cpp是否是最新版本?
您好,感谢您的回复。 chinese_alpaca_lora_7b
从这里下载。
LLaMA-7B
cong从这里下载
运行的python convert.py zh-models/7B/这个命令
报错 Exception: Vocab size mismatch (model has -1, but zh-models/tokenizer.model has 49954).
llama.cpp是从官网下载的最新版本
zh-models/7B
下有什么文件?当前版本的llama.cpp需要把所有模型文件放入convert.py指向的目标目录,而不是把tokenizer.model
放在上一层。再次及时感谢您的回复 1.下载之后合并了 命令是 python scripts/merge_llama_with_chinese_lora.py \ --base_model model/original_llama_hf \ --lora_model model/chinese_alpaca_lora_7b \ --output_dir model 2.zh-models/7B下的文件为
您是说把tokenizer.model放进7B里吗? 请问这三个文件都是所有的模型文件是指tokenizer.model、params .json、consolidated.00.pth这三个吗? 以及这三个文件都是指合并后的模型文件吗?
合并步骤生成的consolidated.00.pth、 params.json、tokenizer.model放在同一个文件夹下,convert.py指向这个文件夹。
感谢您的及时回复 我按照您说的步骤做了 还是报错
params.json
内容是什么?看错误提示是模型的词表大小与tokenizer的大小不一致。
另外,一代模型已经不推荐使用了,可考虑使用二代模型。我们也提供了直接可下载的GGUF模型。 地址:https://github.com/ymcui/Chinese-LLaMA-Alpaca-2
非常感谢 params.json的内容是
我看看二代模型
vocab size的值中的-1改为49954试试
非常感谢您的指导! 我按您说的修改了vocab size。很有用模型启动成功了 我的量化命令为 ./quantize ./zh-models/7B/ggml-model-f16.gguf ./zh-models/7B/ggml-model-q4_0.gguf q4_0 启动命令为 ./main -m zh-models/7B/ggml-model-q4_0.gguf --color -f prompts/alpaca.txt -ins -c 2048 --temp 0.2 -n 256 --repeat_penalty 1.1 最终效果为
效果感觉有点欠佳,您是否能给我一点建议
好的,我去尝试一下。 非常感谢!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration.
Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance.
提交前必须检查以下项目
问题类型
模型量化和部署
基础模型
Alpaca-7B
操作系统
Linux
详细描述问题
在llama.cpp的第二步生成量化版本模型时出现错误,请问我该怎么办
依赖情况(代码类问题务必提供)
transformers 4.36.0.dev0 peft 0.4.0 torch 2.0.1+cu117
运行日志或截图
Writing zh-models/7B/ggml-model-f16.gguf, format 1 Traceback (most recent call last): File "/home/srz/dzy/chinese-llama/llama.cpp/convert.py", line 1228, in
main()
File "/home/srz/dzy/chinese-llama/llama.cpp/convert.py", line 1223, in main
OutputFile.write_all(outfile, ftype, params, model, vocab, special_vocab, concurrency = args.concurrency, endianess=endianess)
File "/home/srz/dzy/chinese-llama/llama.cpp/convert.py", line 924, in write_all
check_vocab_size(params, vocab)
File "/home/srz/dzy/chinese-llama/llama.cpp/convert.py", line 811, in check_vocab_size
raise Exception(msg)
Exception: Vocab size mismatch (model has -1, but zh-models/tokenizer.model has 49954).