wenda icon indicating copy to clipboard operation
wenda copied to clipboard

'NoneType' object has no attribute 'int4WeightExtractionFloat'

Open beihai2013 opened this issue 1 year ago • 2 comments

Hi there, thanks for your great work. I encoutered the problem 'NoneType' object has no attribute 'int4WeightExtractionFloat' when running a query.

beihai2013 avatar Apr 26 '23 13:04 beihai2013

try : 1.update your glm6b(mayby?)model 2.if you are useing cpu mode.install gcc&openmp

l15y avatar Apr 26 '23 15:04 l15y

https://github.com/THUDM/ChatGLM-6B/issues/214

l15y avatar Apr 26 '23 15:04 l15y

我这边解决方法参考一下:

  • 确认已经安装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")

1

  • 修改wenda/config.xml,修改第46行glm加载方式value为:cpu fp32 2

运行懒人版启动bat,你好之后两分多钟才出结果。感觉没啥实用价值!

3

daidehu6831 avatar May 02 '23 06:05 daidehu6831