Skip to content
Charles
Go back

ChatGLM3 遇到的问题

Updated:
Edit page

接口报错 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 page
Share this post:

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