Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

[BUG] webui.py 重新加载模型会导致 KeyError

Open aquila-zyy opened this issue 1 year ago • 1 comments

问题描述 / Problem Description 重新加载模型会导致 KeyError

复现问题的步骤 / Steps to Reproduce

  1. 执行 python webui.py
  2. 点击 '模型配置 -> 重新加载本地模型'
  3. 问题出现:控制台显示 ERROR <时间戳>: 'THUDM/chatglm-6b'

预期的结果 / Expected Result 重新加载选择的模型

实际结果 / Actual Result 未能加载模型并报错

环境信息 / Environment Information

  • langchain-ChatGLM 版本号:0.0.174
  • 是否使用 Docker 部署:否
  • 使用的模型:ChatGLM-6B
  • 使用的 Embedding 模型:text2vec-large-chinese
  • 操作系统及版本:Ubuntu 22.04.2 LTS
  • Python 版本:Python 3.10.6
  • 其他相关环境信息 / Other relevant environment information:

附加信息 / Additional Information 似乎是由于 ./models/shared.py 中的这行代码导致的。首次加载模型时默认使用本地模型导致模型名称里多了个路径。

aquila-zyy avatar May 26 '23 06:05 aquila-zyy

在最近的更新后,如果要加载本地模型,需要把config中的no_remote_model设为true,并且在程序运行期间不能改变,否则就会出现这个错误。

或者你把模型配置中的name和pretrained name改成一样应该也能暂时规避这个问题

liunux4odoo avatar May 31 '23 05:05 liunux4odoo