使用模型:调用模型函数,实现文本生成的功能。 需要注意的是,Xorbits/chatglm3-ggml 需要适当的参数配置才能运行,建议参照官方文档进行设置,才能获得最佳效果。
import chatglm_cpp pipeline = chatglm_cpp.Pipeline("../chatglm3-ggml.bin") pipeline.chat(["你好"]) Traceback (most recent call last): File "", line 1, in File "/opt/conda/lib/python3.8/site-packages/chatglm_cpp/init.py", line 60, in chat messages = [_ensure_chat_message(ms...