chatglm.cpp
chatglm.cpp copied to clipboard
ChatGLM3 使用 examples/cli_demo.py 时报错 'TypeError: chat() got an unexpected keyword argument 'max_new_tokens''
examples git:(main) python3 cli_demo.py -m ../chatglm3-ggml.bin -p 你好 --temp 0.8 --top_p 0.8
Traceback (most recent call last):
File "/Users/XXX/Documents/git/chatGLM/chatglm.cpp/examples/cli_demo.py", line 155, in <module>
main()
File "/Users/XXX/Documents/git/chatGLM/chatglm.cpp/examples/cli_demo.py", line 93, in main
for chunk in pipeline.chat(messages, **generation_kwargs):
TypeError: chat() got an unexpected keyword argument 'max_new_tokens'
我也遇到这个问题,然后改了下下面的代码就好了:
generation_kwargs = dict(
max_length=args.max_length,
- max_new_tokens=args.max_new_tokens,
+ # max_new_tokens=args.max_new_tokens,
max_context_length=args.max_context_length,
do_sample=args.temp > 0,
top_k=args.top_k,