CPT
CPT copied to clipboard
bart-large-chinese在自定义的数据集上进行进一步的预训练
请问如果我想将bart-large-chinese在自定义的数据集上进行进一步的预训练,大概的流程是怎样的?万分感谢!
我们使用Megatron-LM预训练的,需要先处理数据成要求的格式,你可以参考他的readme。
然后运行run_pretrain_bart.sh就可以了
在 2022年1月14日,00:36,maojinyang @.***> 写道:
请问如果我想将bart-large-chinese在自定义的数据集上进行进一步的预训练,大概的流程是怎样的?万分感谢!
— Reply to this email directly, view it on GitHubhttps://github.com/fastnlp/CPT/issues/25, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFJMEDS2NYRTTS64DOLIRKLUV35P7ANCNFSM5L4KRYTQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.***>
run_pretrain_bart.sh中的参数设置似乎是针对base版本的,我按照large版本进行了参数修改,得到的模型经过convert_ckpt.py处理之后在模型load时还是会报错
还有一个问题是在进一步预训练中load的模型是可以直接使用huggingface-transfoemers上的权重吗?感谢解答!
这个转换脚本就是转成transformers的,但它是针对CPT的,回头我更新一下。
在 2022年1月14日,11:27,TUR1NG @.***> 写道:
还有一个问题是在进一步预训练中load的模型是可以直接使用huggingface-transfoemers上的权重吗?感谢解答!
— Reply to this email directly, view it on GitHubhttps://github.com/fastnlp/CPT/issues/25#issuecomment-1012716704, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFJMEDRXUZ5PISNI6ZUJLSTUV6JZNANCNFSM5L4KRYTQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.***>
好的,麻烦您了!
我检查了以下,convert_ckpt.py是可以转换BART的权重到transformers的。load会报错可能是模型config和实际参数没对齐,建议重点检查一下config的vocab_size和max_position_embeddings
我直接使用了transformers上的chinese-bart-large的config和权重文件,但是预训练的运行脚本中还是要对num-layers、hidden-size等参数进行设定。我按照large版本的设置进行了修改,但不确定是否修改完全。我想可能是这个原因?感谢解答。
你可以发一下报错截图
我刚刚再试了一遍,发现又不会报错了,可能是我之前的操作有问题。非常感谢您的帮助,实在是不好意思!
run_pretrain_bart.sh中的参数设置似乎是针对base版本的,我按照large版本进行了参数修改,得到的模型经过convert_ckpt.py处理之后在模型load时还是会报错
想问一下你用barge版本进行参数修改的时候,seq-length设置是多少,需要和max-position-embedding对齐吗?