Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'ExtraValues' from 'pydantic.config' 运行examples的代码,请问出现这个问题如何解决?能否说明一下库所需要的pydantic版本 #1

Closed
zxjhellow2 opened this issue Mar 3, 2024 · 2 comments

Comments

@zxjhellow2
Copy link

zxjhellow2 commented Mar 3, 2024

import os
from ChatAgent import serve
from ChatAgent.chat_models.base_chat_model import BaseChatModel
from ChatAgent.agents.zhipu_chat_agent import ZhipuChatAgent
from ChatAgent.protocol.openai_api_protocol import MultimodalityChatCompletionRequest

apikey = "xxxx"
class GLM4(BaseChatModel):
def init_agent(self):
self.agent = ZhipuChatAgent(model_name="glm-4", api_key=apikey)
def create_chat_completion(self, request):
return self.agent.act(request)
@serve.create_chat_completion()
async def implement_completions(request: MultimodalityChatCompletionRequest):
return GLM4().create_chat_completion(request)
serve.run(host="localhost", port=6368)

@zxjhellow2
Copy link
Author

当我换了编辑器 在google-colab上运行时,pydantic并没有报错,但是出现 ModuleNotFoundError: No module named 'ChatAgent.chat_models'这个问题

@zxjhellow2
Copy link
Author

解决了 应该是环境的问题 我到找包所在地方彻底删除之后重新安装 就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant