li-plus / chatglm.cpp

C++ implementation of ChatGLM-6B & ChatGLM2-6B & ChatGLM3 & GLM4
MIT License
2.81k stars 327 forks source link

self.tokenizer is none, how to solve this problem. #328

Open lzj-r opened 1 week ago

lzj-r commented 1 week ago

when submit the content by pressing the button,(run web-demo.py), the fault occur。

error content: File "c:\Users\lzj_r\chatglm.cpp\chatglm_cpp__init__.py", line 68, in chat input_ids = self.tokenizer.apply_chat_template(messages, max_context_length) AttributeError: 'NoneType' object has no attribute 'apply_chat_template'

lzj-r commented 3 days ago

奇怪的很,cpp 的 pipline 里有 tokenizer的定义,为啥运行后就显示为 None

lzj-r commented 2 days ago

import chatglm_cpp 必须把文件夹名改成 chatglmcpp,否则不认。

lzj-r commented 2 days ago

完美解决,自己爬坑