ymcui / Chinese-LLaMA-Alpaca

中文LLaMA&Alpaca大语言模型+本地CPU/GPU训练部署 (Chinese LLaMA & Alpaca LLMs)
https://github.com/ymcui/Chinese-LLaMA-Alpaca/wiki
Apache License 2.0
18.23k stars 1.86k forks source link

33bplus模型用llama.cpp进行中文对话回复异常 #778

Closed mafamily2496 closed 1 year ago

mafamily2496 commented 1 year ago

提交前必须检查以下项目

问题类型

模型量化和部署

基础模型

None

操作系统

Linux

详细描述问题

# 请在此处粘贴运行代码(如没有可删除该代码块)

image

依赖情况(代码类问题务必提供)

# 请在此处粘贴依赖情况

运行日志或截图

# 请在此处粘贴运行日志
ymcui commented 1 year ago

多半是你合并的有问题,怎么合并的?

mafamily2496 commented 1 year ago

合并完的模型可以正常对话,转换成llama.cpp的格式就不行了。。33b,13b pro,13b plus都没这个问题

mafamily2496 commented 1 year ago

多半是你合并的有问题,怎么合并的?

使用merge_llama_with_chinese_lora.py脚本进行合并 python merge_llama_with_chinese_lora.py --base_model "E:\models\huggyllama_llama-30b" --lora_model "E:\loras\ziqingyang_chinese-llama-plus-lora-33b","E:\loras\ziqingyang_chinese-alpaca-plus-lora-33b" --output_type huggingface --output_dir "E:\models\chinese-alpaca-plus-33b"

ymcui commented 1 year ago

llama.cpp启动的命令是什么?

mafamily2496 commented 1 year ago

llama.cpp启动的命令是什么?

build\bin\Release\main.exe -m "E:\models\ggml-chinese-alpaca-plus-33b-q3_k.bin" --color -f ./prompts/alpaca.txt -ins -c 2048 -t 12 -ngl 63

ymcui commented 1 year ago

llama.cpp启动的命令是什么?

build\bin\Release\main.exe -m "E:\models\ggml-chinese-alpaca-plus-33b-q3_k.bin" --color -f ./prompts/alpaca.txt -ins -c 2048 -t 12 -ngl 63

你用的是k-quant系列量化方法,有按教程改代码吗?需要修改llama.cpp文件的一处代码,然后重新编译代码&重新生成量化模型(./quantize 那一步)。 https://github.com/ymcui/Chinese-LLaMA-Alpaca/wiki/llama.cpp量化部署#step-1-克隆和编译llamacpp

ymcui commented 1 year ago

另外,还有一处可疑的地方,就是-ngl 63,你减小一点-ngl 60或者更低试一下。 GPU加载的时候会有bug,不确定你这个是不是这种情况。

mafamily2496 commented 1 year ago

llama.cpp启动的命令是什么?

build\bin\Release\main.exe -m "E:\models\ggml-chinese-alpaca-plus-33b-q3_k.bin" --color -f ./prompts/alpaca.txt -ins -c 2048 -t 12 -ngl 63

你用的是k-quant系列量化方法,有按教程改代码吗?需要修改llama.cpp文件的一处代码,然后重新编译代码&重新生成量化模型(./quantize 那一步)。 https://github.com/ymcui/Chinese-LLaMA-Alpaca/wiki/llama.cpp量化部署#step-1-克隆和编译llamacpp

这个没有,我试下

mafamily2496 commented 1 year ago

另外,还有一处可疑的地方,就是-ngl 63,你减小一点-ngl 60或者更低试一下。 GPU加载的时候会有bug,不确定你这个是不是这种情况。

确实是GPU层数的问题,改到61就正常了,我是2080TI 22G 编译配置为开启LLAMA_CUBLAS和LLAMA_CUDA_DMMV_F16

ymcui commented 1 year ago

另外,推荐使用Alpaca-Pro(合并时先llama-plus-lora,后alpaca-pro-lora),回复相对更好一些。当然,如果你喜欢短回复的话就用Plus也无妨。

mafamily2496 commented 1 year ago

另外,推荐使用Alpaca-Pro(合并时先llama-plus-lora,后alpaca-pro-lora),回复相对更好一些。当然,如果你喜欢短回复的话就用Plus也无妨。

如果要用于知识库问答,是推荐33plus还是13pro