zjunlp / DeepKE

[EMNLP 2022] An Open Toolkit for Knowledge Graph Extraction and Construction
http://deepke.zjukg.cn/
MIT License
3.6k stars 694 forks source link

llm范例run.py执行问题 #542

Closed zhuweigang closed 5 months ago

zhuweigang commented 5 months ago

llm范例按照README.md安装了: pip install git+https://github.com/zjunlp/EasyInstruct pip install hydra-core

然后执行run.py报如下错误:

OS: ubuntu 20.04 Python Version 3.9 NVIDIA RTX 3090

Screenshots: Traceback (most recent call last): File "/root/DeepKE/example/llm/LLMICL/run.py", line 6, in from easyinstruct.prompts import IEPrompt File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/init.py", line 1, in from .prompts import * File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/prompts/init.py", line 1, in from .base_prompt import BasePrompt File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/prompts/base_prompt.py", line 3, in import cohere File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/cohere/init.py", line 3, in from .types import ( File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/cohere/types/init.py", line 22, in from .chat_stream_end_event import ChatStreamEndEvent File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/cohere/types/chat_stream_end_event.py", line 10, in from .non_streamed_chat_response import NonStreamedChatResponse File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/cohere/types/non_streamed_chat_response.py", line 15, in from .message import Message File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/cohere/types/message.py", line 17, in class Message_Chatbot(UncheckedBaseModel): 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/anaconda3/envs/deepke/lib/python3.9/typing.py", line 852, in subclasscheck return issubclass(cls, self.origin) TypeError: issubclass() arg 1 must be a class

麻烦大神帮看一下是什么原因哈

OE-Heart commented 5 months ago

可能是 coherepydantic 的版本之间存在不兼容问题,请您尝试安装cohere==4.31.0,或者按原步骤重新安装我们更新了安装依赖的easyinstruct

zhuweigang commented 5 months ago

指定安装corehere==4.31.0后,报另一个错。。 Traceback (most recent call last): File "/root/DeepKE/example/llm/LLMICL/run.py", line 6, in from easyinstruct.prompts import IEPrompt File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/init.py", line 1, in from .prompts import File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/prompts/init.py", line 1, in from .base_prompt import BasePrompt File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/prompts/base_prompt.py", line 13, in from easyinstruct.engines import BaseEngine File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/engines/init.py", line 1, in from .base_engine import BaseEngine File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/easyinstruct/engines/base_engine.py", line 1, in from transformers import AutoTokenizer File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/transformers/init.py", line 26, in from . import dependency_versions_check File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/transformers/dependency_versions_check.py", line 16, in from .utils.versions import require_version, require_version_core File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/transformers/utils/init.py", line 33, in from .generic import ( File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/transformers/utils/generic.py", line 465, in import torch.utils._pytree as _torch_pytree File "/root/anaconda3/envs/deepke/lib/python3.9/site-packages/torch/init.py", line 239, in from torch._C import # noqa: F403 ImportError: /root/anaconda3/envs/deepke/lib/python3.9/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclCommRegister

OE-Heart commented 5 months ago

还是因为版本冲突的问题,您试一试重新pip install git+https://github.com/zjunlp/EasyInstruct吧

zhuweigang commented 5 months ago

重装EasyInstruct后问题解决,谢谢