Views
No views yet
1>>> from transformers import MvpTokenizer, MvpForConditionalGeneration
2
3>>> tokenizer = MvpTokenizer.from_pretrained("RUCAIBox/mvp")
4>>> model = MvpForConditionalGeneration.from_pretrained("RUCAIBox/mtl-story")
5
6>>> inputs = tokenizer(
7... "Given the story title: I think all public schools should have a uniform dress code.",
8... return_tensors="pt",
9... )
10>>> generated_ids = model.generate(**inputs, max_length=1024)
11>>> tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
12["I don't know about you, but I don't think it would be a good idea to have a uniform dress code in public schools. I think it's a waste of time and money. If you're going to have uniform dress codes, you need to make sure that the uniforms are appropriate for the school and that the students are comfortable in them. If they're not comfortable, then they shouldn't be allowed to wear them."]1@article{tang2022mvp,
2 title={MVP: Multi-task Supervised Pre-training for Natural Language Generation},
3 author={Tang, Tianyi and Li, Junyi and Zhao, Wayne Xin and Wen, Ji-Rong},
4 journal={arXiv preprint arXiv:2206.12131},
5 year={2022},
6 url={https://arxiv.org/abs/2206.12131},
7}