HillZhang1999 / SynGEC

Code & data for our EMNLP2022 paper "SynGEC: Syntax-Enhanced Grammatical Error Correction with a Tailored GEC-Oriented Parser"
https://arxiv.org/abs/2210.12484
MIT License
79 stars 14 forks source link

微调的GOPar下载好像有问题 #29

Closed Lj4040 closed 10 months ago

Lj4040 commented 11 months ago

image 下载完解压之后是有data,并不是模型,我没有找到相应的文件,在脚本中gopar_model/model,是应该把下载的文件放到对应的目录,我试了下载的的,在运行时都不正确, 截图 2023-11-19 17-45-03

HillZhang1999 commented 11 months ago

你是不是下载成数据了?我这里看似乎没问题呀

1215thebqtic commented 10 months ago

你好,我也遇到了这个问题,还是说解压出来的就是模型?请问是怎么解决的呀

HillZhang1999 commented 10 months ago

请问下载的是哪个模型?

1215thebqtic commented 10 months ago

请问下载的是哪个模型?

我看了之前的issue,应该下载是对的,但是我加载模型的时候报这个错误,不好意思对huggingface不太熟,他这个错误是需要从网上下载什么东西吗?谢谢!

from supar import Parser dep = Parser.load('../../model/gopar/emnlp2022_syngec_biaffine-dep-electra-zh-gopar') Traceback (most recent call last): File "", line 1, in File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/supar/parsers/parser.py", line 194, in load state = torch.load(path if os.path.exists(path) else download(supar.MODEL[src].get(path, path), reload=reload)) File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/torch/serialization.py", line 712, in load return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load result = unpickler.load() File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/supar/utils/field.py", line 120, in setstate state['tokenize'] = AutoTokenizer.from_pretrained(tokenize_args[1]).tokenize File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 522, in from_pretrained tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, kwargs) File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 380, in get_tokenizer_config resolved_config_file = get_file_from_repo( File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/utils/hub.py", line 687, in get_file_from_repo resolved_file = cached_path( File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/utils/hub.py", line 284, in cached_path output_path = get_from_cache( File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/utils/hub.py", line 554, 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.

1215thebqtic commented 10 months ago

另外我下载的这个东西,他就是一个文件,也不是一个文件夹,所以不是很清楚,模型文件是不是就是这个东西?谢谢

1215thebqtic commented 10 months ago

我发现错了,应该是我没下载这个模型,所以会报那个错...hfl/chinese-electra-180g-large-discriminator

wrq9 commented 2 months ago

请问下载的是哪个模型?

我看了之前的issue,应该下载是对的,但是我加载模型的时候报这个错误,不好意思对huggingface不太熟,他这个错误是需要从网上下载什么东西吗?谢谢!

from supar import Parser dep = Parser.load('../../model/gopar/emnlp2022_syngec_biaffine-dep-electra-zh-gopar') Traceback (most recent call last): File "", line 1, in File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/supar/parsers/parser.py", line 194, in load state = torch.load(path if os.path.exists(path) else download(supar.MODEL[src].get(path, path), reload=reload)) File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/torch/serialization.py", line 712, in load return _load(opened_zipfile, map_location, pickle_module, pickle_load_args) File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load result = unpickler.load() File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/supar/utils/field.py", line 120, in setstate state['tokenize'] = AutoTokenizer.from_pretrained(tokenize_args[1]).tokenize File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 522, in from_pretrained tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, kwargs) File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 380, in get_tokenizer_config resolved_config_file = get_file_from_repo( File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/utils/hub.py", line 687, in get_file_from_repo resolved_file = cached_path( File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/utils/hub.py", line 284, in cached_path output_path = get_from_cache( File "/mnt/liu/software/miniconda/miniconda3.8/envs/syngec/lib/python3.8/site-packages/transformers/utils/hub.py", line 554, 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.

你好,请问解决了吗?我也有这个问题