Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not found models/model.zh.seed-1 #3

Open
canghaiyunfan opened this issue Dec 8, 2023 · 3 comments
Open

not found models/model.zh.seed-1 #3

canghaiyunfan opened this issue Dec 8, 2023 · 3 comments

Comments

@canghaiyunfan
Copy link

感谢作者开源代码,但运行pred_zh.sh 过程中遇到了问题

RuntimeError: File models/model.zh.seed-1 unavailable. Please try other sources.

想请教下脚本中用到的文件 去哪下载,例如
gec_path:=models/model.zh.seed-1
lm_path:=uer/gpt2-chinese-cluecorpussmall
ged_path:=models/ged_model.zh.seed-1
mucgec.dev.collapsed

@Jacob-Zhou
Copy link
Owner

您好,GEC 和 GED 文件可以参考 Download Trained Models 章节下载,其中 GEC 和 GED 文件的仓库名 HQZhou/bart-large-chinese-gec 和 HQZhou/bart-large-chinese-ged, 下载完后请参考 Run 设置路径。

数据集文件可以到 MuCGEC 中下载,然后参考 Setup 修改格式。

@canghaiyunfan
Copy link
Author

@Jacob-Zhou 按照要求下载文件后仍报错

config: configs/bart.ini
path: /tmp/tmp.KdmvoLL3Sr
suffix: �
gec_path: models/gecdi/bart-large-gec/model
lm_path: uer/gpt2-chinese-cluecorpussmall
lm_alpha: 0.0
lm_beta: 0
ged_path: models/gecdi/bart-large-ged/model
ged_alpha: 0.0
ged_beta: 0
devices: 0
batch: 1000
beam: 12
dataset: mucgec.dev
data: data/cgec/mucgec.dev.collapsed
gold: data/cgec/mucgec.dev.m2
pred: models/gecdi/bart-large-gec/pred/mucgec.dev/baseline/mucgec.dev.beam-12.pred
Traceback (most recent call last):
File "gecdi/scripts/predict_utils/split_discourse.py", line 25, in
tokenize_func = Seq2SeqParser.load(args.path).SRC.tokenize
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "gecdi/supar/parser.py", line 495, in load
model.load_state_dict(state['state_dict'], False)
File "/miniconda3/envs/bert/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Seq2SeqModel:
size mismatch for model.shared.weight: copying a param with shape torch.Size([50265, 1024]) from checkpoint, the shape in current model is torch.Size([50264, 1024]).
size mismatch for model.encoder.embed_tokens.weight: copying a param with shape torch.Size([50265, 1024]) from checkpoint, the shape in current model is torch.Size([50264, 1024]).
size mismatch for model.decoder.embed_tokens.weight: copying a param with shape torch.Size([50265, 1024]) from checkpoint, the shape in current model is torch.Size([50264, 1024]).
size mismatch for encoder.embed_tokens.weight: copying a param with shape torch.Size([50265, 1024]) from checkpoint, the shape in current model is torch.Size([50264, 1024]).
size mismatch for decoder.embed_tokens.weight: copying a param with shape torch.Size([50265, 1024]) from checkpoint, the shape in current model is torch.Size([50264, 1024]).
size mismatch for classifier.weight: copying a param with shape torch.Size([50265, 1024]) from checkpoint, the shape in current model is torch.Size([50264, 1024]).

@Jacob-Zhou
Copy link
Owner

您好我这边尝试复现一下这个问题,可能需要点时间。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants