zjunlp / DeepKE

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

本地把预训练模型放在了pretrained文件夹下,如何调用? #419

Closed liujunshanhelen closed 8 months ago

liujunshanhelen commented 8 months ago

[2024-03-05 12:15:21,094][huggingface_hub.utils._http][WARNING] - 'HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-chinese/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000169C7E70550>, 'Connection to huggingface.co timed out. (connect timeout=10)'))' thrown while requesting HEAD https://huggingface.co/bert-base-chinese/resolve/main/config.json 'HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /bert-base-chinese/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000169C7E70550>, 'Connection to huggingface.co timed out. (connect timeout=10)'))' thrown while requesting HEAD https://huggingface.co/bert-base-chinese/resolve/main/config.json Traceback (most recent call last): File "C:\Users\LiuJunshan\Desktop\DeepKE-main\DeepKE-main\example\re\standard\run.py", line 92, in main model = Modelcfg.model_name File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\deepke\relation_extraction\standard\models\LM.py", line 14, in init self.bert = BertModel.from_pretrained(cfg.lm_file, num_hidden_layers=cfg.num_hidden_layers) File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\transformers\modeling_utils.py", line 2079, in from_pretrained config, model_kwargs = cls.config_class.from_pretrained( File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\transformers\configuration_utils.py", line 538, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, kwargs) File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\transformers\configuration_utils.py", line 565, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, kwargs) File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\transformers\configuration_utils.py", line 620, in _get_config_dict resolved_config_file = cached_file( File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\transformers\utils\hub.py", line 409, in cached_file resolved_file = hf_hub_download( File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\huggingface_hub\utils_validators.py", line 124, in _inner_fn return fn(*args, **kwargs) File "C:\Users\LiuJunshan\miniconda3\envs\deepke\lib\site-packages\huggingface_hub\file_download.py", line 1148, in hf_hub_download with open(ref_path) as f:

BeasterYong commented 8 months ago

您好,使用本地模型时需要修改example/re/standard/conf/model/lm.yaml中的lm_file为本地模型存储目录

zxlzr commented 8 months ago

请问您的问题解决了吗

liujunshanhelen commented 8 months ago

解决了