JittorLLMs icon indicating copy to clipboard operation
JittorLLMs copied to clipboard

chatglm run_web_demo use chat or stream_chat

Open AIxyz opened this issue 1 year ago • 0 comments

用现有代码跑 web_demo.py 时速度很慢,经定位发现是因为 models/chatglm/__init__.py 中 run_web_demo 调用 run 使用了 chat 接口

为换成调用 stream_chat 接口,在 web_demo.py 里强行将代码修改如下是可以正常使用的:

    # for response, history in model.run_web_demo(input, history):
    for response, history in model.model.stream_chat(model.tokenizer, input, history):

请问有更好的修改 run_web_demo 的方法吗

AIxyz avatar Jun 07 '23 02:06 AIxyz