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 CTRL Model #921

Merged
merged 12 commits into from
Nov 11, 2021
Merged

add CTRL Model #921

merged 12 commits into from
Nov 11, 2021

Conversation

JunnYu
Copy link
Member

@JunnYu JunnYu commented Aug 25, 2021

飞桨论文复现挑战赛(第四期)CTRL: A Conditional Transformer Language Model for Controllable Generation 论文复现提交。

@yingyibiao
Copy link
Contributor

前向输出还需要再定位清楚不一致的op!

@ZeyuChen
Copy link
Member

这个PR还有效吗?@yingyibiao

@yingyibiao
Copy link
Contributor

这个PR还有效吗?@yingyibiao

有效

Copy link
Contributor

@smallv0221 smallv0221 left a comment

Choose a reason for hiding this comment

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

Things in utils.py is too familiar to HuggingFace. Please change them to PaddleNLP-style. And add more doc. You can see other model for details.

paddlenlp/transformers/ctrl/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/ctrl/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/ctrl/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/ctrl/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/ctrl/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/ctrl/modeling.py Outdated Show resolved Hide resolved
paddlenlp/transformers/ctrl/tokenizer.py Show resolved Hide resolved
@JunnYu
Copy link
Member Author

JunnYu commented Nov 8, 2021

CTRL权重文件
链接:https://pan.baidu.com/s/1JsxGtNBHK7VSlUnr_mByCA
提取码:4834
--来自百度网盘超级会员V5的分享

numerical representations of tokens that build the input sequence.
Its data type should be `int64` and it has a shape of [batch_size, sequence_length].
cache (Tuple[Tuple[Tensor]], optional):
Contains pre-computed hidden-states (key and values in the attention blocks) as computed by the model. Can be used to speed up sequential decoding. The `input_ids` which have their past given to this model should not be passed as input ids as they have already been computed.
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的文档单行不要太长,最好每85个字符左右换行一次

Copy link
Member Author

Choose a reason for hiding this comment

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

done

paddlenlp/transformers/ctrl/__init__.py Outdated Show resolved Hide resolved
smallv0221
smallv0221 previously approved these changes Nov 9, 2021
Copy link
Contributor

@smallv0221 smallv0221 left a comment

Choose a reason for hiding this comment

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

LGTM

@yingyibiao
Copy link
Contributor

需要在example/text_generation下面新增一个使用案例

@JunnYu
Copy link
Member Author

JunnYu commented Nov 11, 2021

需要在example/text_generation下面新增一个使用案例

已添加,测试生成结果如下。
image

@yingyibiao yingyibiao merged commit 755ccf0 into PaddlePaddle:develop Nov 11, 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.

4 participants