THU-KEG / OmniEvent

A comprehensive, unified and modular event extraction toolkit.
https://omnievent.readthedocs.io/
MIT License
331 stars 31 forks source link

成功安装后首次运行报错 #53

Open sunry1123 opened 4 months ago

sunry1123 commented 4 months ago

成功安装后运行报错 `from OmniEvent.infer import infer

Even Extraction (EE) Task

text = "2022年北京市举办了冬奥会" results = infer(text=text, task="EE") print(results[0]["events"])` 发生如下报错: Downloading: 0%| | 0.00/1.77G [00:00<?, ?B/s]1901858561 Downloading Downloading: 100%|████████████████████████████████████████████████████████████████| 1.77G/1.77G [01:14<00:00, 25.4MB/s] Archive: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed.zip creating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/ inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_5.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/config.json inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_3.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/pytorch_model.bin inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/spiece.model extracting: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/latest inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_7.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_0.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/special_tokens_map.json inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/trainer_state.json inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/tokenizer.json inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_4.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/args.yaml inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/zero_to_fp32.py inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_1.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/tokenizer_config.json inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_2.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/rng_state_6.pth inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/added_tokens.json inflating: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-ed/training_args.bin load from local file: C:\Users\lenovo/.cache/OmniEvent_Model\s2s-mt5-ed tokenizer download from web, cache will be save to: C:\Users\lenovo/.cache/OmniEvent_Model/s2s-mt5-eae.zip Downloading: 0%| | 0.00/3.88G [00:00<?, ?B/s]4167695152 Downloading Downloading: 100%|████████████████████████████████████████████████████████████████| 3.88G/3.88G [03:04<00:00, 22.6MB/s] Archive: C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-eae.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-eae.zip, and cannot find C:/Users/lenovo/.cache/OmniEvent_Model/s2s-mt5-eae.zip.zip, period. Traceback (most recent call last): File "D:\python3.10安装\lib\site-packages\transformers\configuration_utils.py", line 623, in _get_config_dict resolved_config_file = cached_path( File "D:\python3.10安装\lib\site-packages\transformers\utils\hub.py", line 284, in cached_path output_path = get_from_cache( File "D:\python3.10安装\lib\site-packages\transformers\utils\hub.py", line 562, in get_from_cache raise ValueError( ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "D:\python3.10安装\lib\site-packages\OmniEvent\infer.py", line 135, in infer eae_model, eae_tokenizer = get_pretrained("s2s-mt5-eae", device) File "D:\python3.10安装\lib\site-packages\OmniEvent\infer.py", line 67, in get_pretrained model = get_model(model_args, model_name_or_path) File "D:\python3.10安装\lib\site-packages\OmniEvent\infer.py", line 57, in get_model model = get_model_cls(model_args).from_pretrained(path) File "D:\python3.10安装\lib\site-packages\transformers\modeling_utils.py", line 1840, in from_pretrained config, model_kwargs = cls.config_class.from_pretrained( File "D:\python3.10安装\lib\site-packages\transformers\configuration_utils.py", line 534, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, kwargs) File "D:\python3.10安装\lib\site-packages\transformers\configuration_utils.py", line 561, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, kwargs) File "D:\python3.10安装\lib\site-packages\transformers\configuration_utils.py", line 656, in _get_config_dict raise EnvironmentError( OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like C:\Users\lenovo/.cache/OmniEvent_Model/s2s-mt5-eae is not the path to a directory containing a config.json file. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'. 屏幕截图 2024-02-26 224947

jqianaaaa commented 4 months ago

是的我也这样,不知道怎末解决

h-peng17 commented 4 months ago

看起来是/.cache/OmniEvent_Model/下的zipfile未能成功解压缩的问题,你可以手动将/.cache/OmniEvent_Model/文件夹下的zip文件解压缩。

sunry1123 commented 4 months ago

看起来是/.cache/OmniEvent_Model/下的zipfile未能成功解压缩的问题,你可以手动将/.cache/OmniEvent_Model/文件夹下的zip文件解压缩。

我可以正常下载ed模型,使用事件检测功能模块,但是无法正常下载eae模型,请问是什么原因呀

sunry1123 commented 4 months ago

是的我也这样,不知道怎末解决

请问您解决了吗

h-peng17 commented 4 months ago
  1. 你可以先到“/.cache/OmniEvent_Model/”文件夹查看模型文件是否下载成功。
  2. eae模型需要占用比较大的显存,你可以查看下是否是显存oom的问题。
jqianaaaa commented 4 months ago
  1. 你可以先到“/.cache/OmniEvent_Model/”文件夹查看模型文件是否下载成功。
  2. eae模型需要占用比较大的显存,你可以查看下是否是显存oom的问题。

您好,该模型我无法下载成功,请问有什么解决办法呢?

jqianaaaa commented 4 months ago

是的我也这样,不知道怎末解决

请问您解决了吗

没有哎,现在因为这个模型已经卡住了

h-peng17 commented 3 months ago

可以手动下载模型到对应的位置