Skip to content
Go back

ChatGLM3 遇到的问题

Updated:  at  02:50 PM
Edit

接口报错 AttributeError: type object ‘UsageInfo’ has no attribute ‘model_validate’

https://github.com/THUDM/ChatGLM3/issues/398

# 把 openai_api.py 中的
task_usage = UsageInfo.model_validate(response["usage"])
for usage_key, usage_value in task_usage.model_dump().items():

# 替换成
task_usage = UsageInfo.parse_obj(response["usage"])
for usage_key, usage_value in task_usage.dict().items():

Edit

Previous Post
sd-webui-comfyui 遇到的问题
Next Post
Langchain-Chatchat 遇到的问题