fastllm icon indicating copy to clipboard operation
fastllm copied to clipboard

测试baichuan2-7b报错

Open tianchaolangzi opened this issue 1 year ago • 4 comments

运行chaglm成功,但是测试baichuan2-7b-chat出错

测试代码: import sys from transformers import AutoModelForCausalLM, AutoTokenizer from transformers.generation.utils import GenerationConfig

model_path = '/data/zhoukai/open_models/Baichuan/Baichuan2-7B-Chat' model = AutoModelForCausalLM.from_pretrained(model_path, device_map='cpu', trust_remote_code=True) tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True) model.generation_config = GenerationConfig.from_pretrained(model_path)

from build.tools.fastllm_pytools import llm model = llm.from_hf(model, tokenizer, dtype = "float16") # dtype支持 "float16", "int8", "int4"

print(model.chat(tokenizer, "你好"))

print(model.response("你好"))

错误: convert ( 227 / 227 ) Warmup... finish. status = 7 6785 1 128 Error: cublas error. Aborted (core dumped)

tianchaolangzi avatar Sep 15 '23 02:09 tianchaolangzi

我也使用这个模型,转换成功了,但是使用起来返回的结果是错误的符号。 model = AutoModelForCausalLM.from_pretrained(model_path, device_map='cpu', trust_remote_code=True) 这行增加torch_dtype=torch.float16即可

91he avatar Sep 15 '23 05:09 91he

【转换成功了,但是使用起来返回的结果是错误的符号。】 +1

我使用 baichuan2-13b-chat-fp16.flm 是没有问题的

baichuan2 7b 和 13b有个差别是位置编码方式不同,是不是项目没有正确处理这里?

lockmatrix avatar Sep 24 '23 06:09 lockmatrix

【转换成功了,但是使用起来返回的结果是错误的符号。】 +1

我使用 baichuan2-13b-chat-fp16.flm 是没有问题的

baichuan2 7b 和 13b有个差别是位置编码方式不同,是不是项目没有正确处理这里?

位置编码的问题我在群里已经反馈了,但是好像还没有得到响应。

91he avatar Sep 24 '23 15:09 91he

baichuan2的转换可以参考对 Baichuan 1 的推理优化迁移到 Baichuan 2 另外baichuan2 7b现在的提示词转换的时候还有一些问题,之后应该会修掉

siemonchan avatar Oct 10 '23 10:10 siemonchan