Closed myfish123456789 closed 6 months ago
There may be incompatibilities between your cohere
and pydantic
versions, can you check them, please?
请问您的问题解决了吗?
Please try installing cohere==4.31.0 or reinstall easyinstruct as per the original steps as we have updated the installation dependencies.
import easyinstruct时出现报错,请问是什么原因呀
Traceback (most recent call last): File "/mnt/DeepKE/example/llm/LLMICL/run.py", line 8, in <module> import easyinstruct File "/mnt/DeepKE/example/llm/EasyInstruct/easyinstruct/__init__.py", line 1, in <module> from .prompts import * File "/mnt/DeepKE/example/llm/EasyInstruct/easyinstruct/prompts/__init__.py", line 1, in <module> from .base_prompt import BasePrompt File "/mnt/DeepKE/example/llm/EasyInstruct/easyinstruct/prompts/base_prompt.py", line 3, in <module> import cohere File "/root/miniconda3/envs/deepke-llm/lib/python3.9/site-packages/cohere/__init__.py", line 3, in <module> from .types import ( File "/root/miniconda3/envs/deepke-llm/lib/python3.9/site-packages/cohere/types/__init__.py", line 22, in <module> from .chat_stream_end_event import ChatStreamEndEvent File "/root/miniconda3/envs/deepke-llm/lib/python3.9/site-packages/cohere/types/chat_stream_end_event.py", line 10, in <module> from .non_streamed_chat_response import NonStreamedChatResponse File "/root/miniconda3/envs/deepke-llm/lib/python3.9/site-packages/cohere/types/non_streamed_chat_response.py", line 15, in <module> from .message import Message File "/root/miniconda3/envs/deepke-llm/lib/python3.9/site-packages/cohere/types/message.py", line 14, in <module> class Message_Chatbot(ChatMessage): File "pydantic/main.py", line 197, in pydantic.main.ModelMetaclass.__new__ File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.__init__ File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis File "/root/miniconda3/envs/deepke-llm/lib/python3.9/typing.py", line 852, in __subclasscheck__ return issubclass(cls, self.__origin__) TypeError: issubclass() arg 1 must be a class