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

Add T5 model #916

Merged
merged 17 commits into from
Nov 22, 2021
Merged

Add T5 model #916

merged 17 commits into from
Nov 22, 2021

Conversation

JunnYu
Copy link
Member

@JunnYu JunnYu commented Aug 23, 2021

飞桨论文复现挑战赛(第四期)Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer 论文复现提交。

@ZeyuChen
Copy link
Member

@yingyibiao @JunnYu 这个PR还有效吗?

@yingyibiao
Copy link
Contributor

@yingyibiao @JunnYu 这个PR还有效吗?

有效

@yingyibiao
Copy link
Contributor

需要在example/language_model下面新增一个案例

@yingyibiao
Copy link
Contributor

权重已上传~

Copy link
Member

@ZeyuChen ZeyuChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PreTrained -> Pretrained
统一一下这个单词的命名。

paddlenlp/transformers/t5/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/t5/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/t5/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/t5/modeling.py Show resolved Hide resolved
paddlenlp/transformers/t5/modeling.py Show resolved Hide resolved
paddlenlp/transformers/t5/modeling.py Show resolved Hide resolved
paddlenlp/transformers/t5/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/t5/tokenizer.py Show resolved Hide resolved
Comment on lines 1623 to 1626
super().__init__()
self.t5 = t5
del self.t5.decoder
paddle.device.cuda.empty_cache()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T5EncoderModel还是参考hf的实现来写;目前这种写法会存在一个显存占用的脉冲,容易造成oom。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在换成了这种写法,可以吗?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个类建议按照参考T5Model的方式来初始化(传入构造T5EncoderModel的具体参数)

yingyibiao
yingyibiao previously approved these changes Nov 22, 2021
Copy link
Contributor

@yingyibiao yingyibiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

'T5Model',
"T5PretrainedModel",
'T5ForConditionalGeneration',
'T5EncoderModel',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也删除一下

@yingyibiao yingyibiao merged commit ac9d6f9 into PaddlePaddle:develop Nov 22, 2021
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

Successfully merging this pull request may close these issues.

3 participants