Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教chatglm.cpp如何支持chatglm3 的 function calling #193

Open
hfyydd opened this issue Nov 19, 2023 · 7 comments
Open

请教chatglm.cpp如何支持chatglm3 的 function calling #193

hfyydd opened this issue Nov 19, 2023 · 7 comments

Comments

@hfyydd
Copy link

hfyydd commented Nov 19, 2023

同title,能不能给个demo

@hfyydd hfyydd changed the title 请教chatglm3如何支持function calling 请教chatglm.cpp如何支持chatglm3 的 function calling Nov 21, 2023
@gaoshine
Copy link

貌似作者的分支已经开始支持了,new-prompt-fmt。我测试并没有成功,期待作者放出例子,感觉chatglm3的这次prompt的改动有些大,一些token的id大于60000的应该都是保留的token,防止用户注入。

@hfyydd
Copy link
Author

hfyydd commented Nov 22, 2023

等我去测一测

@li-plus
Copy link
Owner

li-plus commented Nov 22, 2023

已经支持了 system prompt / function call / code interpreter,可以跑下 examples/chatglm3_demo.py 这个 demo,参考最新的 README

@wanetcn
Copy link

wanetcn commented Nov 23, 2023

运行这个chatglm3_demo.py 报错。 是这个chatglm_cpp没有更新吗,今天刚安装的环境。

2023-11-22 21:07:14.770 Uncaught app exception
Traceback (most recent call last):
File "/root/ts/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.dict)
File "/root/chatglm.cpp/examples/chatglm3_demo.py", line 71, in
class Message(chatglm_cpp.ChatMessage):
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'chatglm_cpp' has no attribute 'ChatMessage'

@hfyydd
Copy link
Author

hfyydd commented Nov 24, 2023

运行这个chatglm3_demo.py 报错。 是这个chatglm_cpp没有更新吗,今天刚安装的环境。

2023-11-22 21:07:14.770 Uncaught app exception Traceback (most recent call last): File "/root/ts/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script exec(code, module.dict) File "/root/chatglm.cpp/examples/chatglm3_demo.py", line 71, in class Message(chatglm_cpp.ChatMessage): ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'chatglm_cpp' has no attribute 'ChatMessage'

我也报这个错了 我看到ChatMessage 写到_C.pyi这个文件里了。

@li-plus
Copy link
Owner

li-plus commented Nov 24, 2023

可以先看看 chatglm-cpp 版本是否更新到 0.3.0

pip show chatglm-cpp

然后在 examples 路径下执行(不要在 chatglm_cpp 根目录执行):

python3 -c "import chatglm_cpp; chatglm_cpp.ChatMessage"

测试下是否有报错

@hfyydd
Copy link
Author

hfyydd commented Nov 24, 2023

应该是chatglm-cpp版本的问题 pip install -U chatglm-cpp 就ok了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants