add ERNIE_DPCNN.py,change the old "pytorch_pretrained" into new "transformers", change self.bert_path into "bert-base-chinese" to fetch online models#173
Open
zcongfly wants to merge 1 commit into649453932:masterfrom
Conversation
…sformers", change self.bert_path into "bert-base-chinese" to fetch online models
|
您好,请问您在使用ernie微调自己的数据集是,是否会出现train loss和val loss不下降的情况,是采用的优化器的问题嘛? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
主要修改了models文件夹下的文件,新增了ERNIE_DPCNN.py,对models中的每个模型文件均进行了如下修改:
1.把旧的pytorch_pretrained库替换成了新的transformers库
2.将原先用于存放本地下载的预训练模型的路径(self.bert_path)注释掉,修改成transformers库中的模型名称,以便于在线拉取huggingface社区的bert-base-chinese模型。
3.因为模型进行了更新,在每个以Bert作为上层模型的forward函数中修改了Bert模型的输出结果的格式,使其适用于对应下层模型的输入格式要求。
除此之外,对其余文件的修改只是在自己学习过程中补充了一些注释。