Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
YuuuW 2a97ca25b1 | 2 years ago | |
---|---|---|
ctrl | 2 years ago | |
double精度下对比 | 2 years ago | |
hg | 2 years ago | |
paddlenlp | 2 years ago | |
pd | 2 years ago | |
探究ctrl原版权重误差大的原因 | 2 years ago | |
.gitignore | 2 years ago | |
PADDLE-GENERATE.ipynb | 2 years ago | |
PYTORCH-GENERATE.ipynb | 2 years ago | |
README.md | 2 years ago | |
compare_cls.py | 2 years ago | |
compare_generate.IPYNB | 2 years ago | |
compare_lm.py | 2 years ago | |
compare_tokenizer.py | 2 years ago | |
convert.py | 2 years ago |
paddle version “CTRL: A Conditional Transformer Language Model for Controllable Generation”
paddle2.x 实现 CTRL
python convert.py
python compare_lm.py
############ sshleifer-tiny-ctrl
# compare loss:
# mean difference: tensor(0.)
# max difference: tensor(0.)
# compare logits:
# mean difference: tensor(1.2408e-08)
# max difference: tensor(5.6252e-07)
# compare hidden_states:
# mean difference: tensor(4.2710e-08)
# max difference: tensor(3.2783e-06)
# mean difference: tensor(4.3044e-08)
# max difference: tensor(3.2783e-06)
# mean difference: tensor(1.2185e-07)
# max difference: tensor(4.5300e-06)
############ 加载ctrl权重误差非常大,进入文件夹【探究ctrl原版权重误差大的原因】查看原因
python compare_cls.py
############ sshleifer-tiny-ctrl
# compare loss
# mean difference: tensor(2.3842e-07)
# max difference: tensor(2.3842e-07)
# compare logits
# mean difference: tensor(6.0303e-09)
# max difference: tensor(1.4901e-08)
############ 加载ctrl权重误差非常大,进入文件夹【探究ctrl原版权重误差大的原因】查看原因
python compare_tokenizer.py
# input_ids: True
# token_type_ids: True
# attention_mask: True
PADDLE-GENERATE.ipynb
Diet English : I lost 10 kgs! ; German :
Ich habe zehn Kilogramm abgenommen!
Als ich das erste Mal mit meinem Smartphone war, war es ein wenig schwierig zu finden, wo man die App herunterladen kann. Aber jetzt ist sie da.
Das Smartphone hat mich auch sehr beeindruckt. Es machte mir viel Spaß. Und so funktioniert mein Leben heute ganz einfach und ohne große Probleme.
Mein Fazit: Wenn du deine Apps auf dem iPhone oder Android
==================================================
Reviews Rating: 5.0
I have been using this product for a few years now and it is the best thing on the market to keep your teeth white. It does not taste bad at all like some of these other products do. The only problem with this product is that you need to use it every day or else they will start coming back in after about 2 weeks. But if you do that, then it's worth it. You can also buy them from Amazon but shipping takes forever. So just make sure you order enough so you don't run out.
Rating: 5.0
This stuff works great. My dentist recommended it, and I'm glad he did. It's easy to use, tastes good, and
==================================================
Questions Q: What is the capital of India?
A: mumbai.
Q: Who was a British politician who served as Prime Minister from 1922 to 1924?
A: edward viibert
Q: The name of which city in New South Wales has been used for many years by the Australian National Football team?
A: sydney
Q: Which American actor starred with his wife and daughter on the television series 'Family Affair'?
A: james coburn
Q: In what year did the first edition of this book appear?
A: 1962
Q: How long does it take to make one pound of sausage?
A: 24 hours
==================================================
Books Weary with toil, I haste me to my bed,
And sleep till the morning of life is come.
The sun has risen and his beams are bright,
But still he shines upon a world forlorn;
He sees no more its joys or griefs below,
Nor hears their murmur as they pass below.
My heart grows weary for the world's delight,
For all that makes it dear in human eyes;
It feels like one who wanders through an empty land,
With nothing left but desolation there.
O God! how long shall this be mine abode,
Where every joy hath passed away from me?
How long, O God, must I thus wander here,
In sorrow
==================================================
PYTORCH-GENERATE.ipynb
Diet English : I lost 10 kgs! ; German : Ich habe zehn Kilogramm abgenommen!
Als ich das erste Mal mit meinem Smartphone war, war es ein wenig schwierig zu finden, wo man die App herunterladen kann. Aber jetzt ist sie da.
Das Smartphone hat mich auch sehr beeindruckt. Es machte mir viel Spaß. Und so funktioniert mein Leben heute ganz einfach und ohne große Probleme.
Mein Fazit: Wenn du deine Apps auf dem iPhone oder Android
==================================================
Reviews Rating: 5.0
I have been using this product for a few years now and it is the best thing on the market to keep your teeth white. It does not taste bad at all like some of these other products do. The only problem with this product is that you need to use it every day or else they will start coming back in after about 2 weeks. But if you do that, then it's worth it. You can also buy them from Amazon but shipping takes forever. So just make sure you order enough so you don't run out.
Rating: 5.0
This stuff works great. My dentist recommended it, and I'm glad he did. It's easy to use, tastes good, and
==================================================
Questions Q: What is the capital of India?
A: mumbai.
Q: Who was a British politician who served as Prime Minister from 1922 to 1924?
A: edward viibert
Q: The name of which city in New South Wales has been used for many years by the Australian National Football team?
A: sydney
Q: Which American actor starred with his wife and daughter on the television series 'Family Affair'?
A: james coburn
Q: In what year did the first edition of this book appear?
A: 1962
Q: How long does it take to make one pound of sausage?
A: 24 hours
==================================================
Books Weary with toil, I haste me to my bed,
And sleep till the morning of life is come.
The sun has risen and his beams are bright,
But still he shines upon a world forlorn;
He sees no more its joys or griefs below,
Nor hears their murmur as they pass below.
My heart grows weary for the world's delight,
For all that makes it dear in human eyes;
It feels like one who wanders through an empty land,
With nothing left but desolation there.
O God! how long shall this be mine abode,
Where every joy hath passed away from me?
How long, O God, must I thus wander here,
In sorrow
==================================================
RepetitionPenaltyLogitsProcessor
,本项目使用两种方法实现该方法。def __call__(self, input_ids, logits):
# method 1 使用了for循环,好理解,速度不一定快
# score = paddle.index_sample(logits, input_ids)
# score = paddle.where(score < 0, score * self.penalty, score / self.penalty)
# outputs = [paddle.scatter(logit,input_id,score_) for logit,input_id,score_ in zip(logits,input_ids,score)]
# return paddle.stack(outputs,axis=0)
# method2 与之前reformer类似,同样采用了添加offset的方法,使用scatter对flatten后的输入进行操作。
score = paddle.index_sample(logits, input_ids)
score = paddle.where(score < 0, score * self.penalty, score / self.penalty)
input_ids = input_ids + paddle.arange(logits.shape[
0]).unsqueeze(-1) * logits.shape[-1]
return paddle.scatter(logits.flatten(),input_ids.flatten(),score.flatten()).reshape(logits.shape)
@article{keskar2019ctrl,
title={Ctrl: A conditional transformer language model for controllable generation},
author={Keskar, Nitish Shirish and McCann, Bryan and Varshney, Lav R and Xiong, Caiming and Socher, Richard},
journal={arXiv preprint arXiv:1909.05858},
year={2019}
}
@inproceedings{wolf-etal-2020-transformers,
title = "Transformers: State-of-the-Art Natural Language Processing",
author = "Thomas Wolf and Lysandre Debut and Victor Sanh and Julien Chaumond and Clement Delangue and Anthony Moi and Pierric Cistac and Tim Rault and Rémi Louf and Morgan Funtowicz and Joe Davison and Sam Shleifer and Patrick von Platen and Clara Ma and Yacine Jernite and Julien Plu and Canwen Xu and Teven Le Scao and Sylvain Gugger and Mariama Drame and Quentin Lhoest and Alexander M. Rush",
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
month = oct,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://www.aclweb.org/anthology/2020.emnlp-demos.6",
pages = "38--45"
}
paddle version “CTRL: A Conditional Transformer Language Model for Controllable Generation”
Text Python C++ Cuda Jupyter Notebook
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》