ChatGLM3
ChatGLM3 copied to clipboard
type object 'UsageInfo' has no attribute 'model_validate'
System Info / 系統信息
python 3.10
Who can help? / 谁可以帮助到您?
File "D:\chatglm3\openai_api_demo\openai_api.py", line 233, in create_chat_completion task_usage = UsageInfo.model_validate(response["usage"]) AttributeError: type object 'UsageInfo' has no attribute 'model_validate'
Information / 问题信息
- [X] The official example scripts / 官方的示例脚本
- [ ] My own modified scripts / 我自己修改的脚本和任务
Reproduction / 复现过程
python
Expected behavior / 期待表现
不知道问题在哪里
pydantic>=2.5.1
when i install pydantic>=2.5.1, it will have this error:
my pydantic version is :
pydantic 2.6.0 pydantic_core 2.16.1
请问这个问题解决了吗?我也遇到了同样的问题。