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-open-dialog")
5
6>>> inputs = tokenizer(
7... "Given the dialog: do you like dance? [SEP] Yes I do. Did you know Bruce Lee was a cha cha dancer?",
8... return_tensors="pt",
9... )
10>>> generated_ids = model.generate(**inputs)
11>>> tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
12['Yes he won the Hong Kong Cha Cha championship in 1958']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}