wenda
wenda copied to clipboard
'NoneType' object has no attribute 'int4WeightExtractionFloat'
Hi there, thanks for your great work. I encoutered the problem 'NoneType' object has no attribute 'int4WeightExtractionFloat' when running a query.
try : 1.update your glm6b(mayby?)model 2.if you are useing cpu mode.install gcc&openmp
https://github.com/THUDM/ChatGLM-6B/issues/214
我这边解决方法参考一下:
-
确认已经安装gcc,在cmd中运行”gcc -v”测试、确认版本为10.3.0。否则访问tdm-gcc下载。安装时,一定勾选上openmp
-
进到wenda/model/chatglm-6b-int4本地目录,打开cmd,运行如下两个编译命令:
gcc -fPIC -pthread -fopenmp -std=c99 quantization_kernels.c -shared -o quantization_kernels.so
gcc -fPIC -pthread -fopenmp -std=c99 quantization_kernels_parallel.c -shared -o quantization_kernels_parallel.so
- 修改wenda/plugins/llm_glm6b.py:
if device == 'cpu':
# 如果是cpu,不做任何操作
上述代码后,新增如下:
model = model.quantize(bits=4, kernel_file="实际目录\\wenda\\model\\chatglm-6b-int4\\quantization_kernels.so")
- 修改wenda/config.xml,修改第46行glm加载方式value为:cpu fp32
运行懒人版启动bat,你好之后两分多钟才出结果。感觉没啥实用价值!