Views
No views yet


1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2
3model = AutoModelForSeq2SeqLM.from_pretrained("gonglinyuan/metro_t0p_largepp", trust_remote_code=True)
4tokenizer = AutoTokenizer.from_pretrained("gonglinyuan/metro_t0p_largepp", trust_remote_code=True)
5
6input_text = "Is this review positive or negative? Review: this is the best cast iron skillet you will ever buy"
7inputs = tokenizer([input_text], max_length=512, truncation=True, add_special_tokens=True, return_tensors="pt").input_ids
8outputs = model.generate(inputs, max_new_tokens=256, do_sample=False)
9
10print(tokenizer.decode(outputs[0], skip_special_tokens=True)) # expected: positive| # Parameters | Pretraining Data | Prompt-Finetuning Data | |
|---|---|---|---|
| METRO-T0-Base | 226M | Wikibook (16G) | T0 Train |
| METRO-T0+-Base | 226M | Wikibook (16G) | T0+ Train |
| METRO-T0++-Base | 226M | Wikibook (16G) | T0++ Train |
| METRO-T0-Base++ | 256M | 160G corpus | T0 Train |
| METRO-T0+-Base++ | 256M | 160G corpus | T0+ Train |
| METRO-T0++-Base++ | 256M | 160G corpus | T0++ Train |
| METRO-T0-Large++ | 775M | 160G corpus | T0 Train |
| METRO-T0+-Large++ | 775M | 160G corpus | T0+ Train |
| METRO-T0++-Large++ | 775M | 160G corpus | T0++ Train |
@misc{gong2023modelgenerated,
title={Model-Generated Pretraining Signals Improves Zero-Shot Generalization of Text-to-Text Transformers},
author={Linyuan Gong and Chenyan Xiong and Xiaodong Liu and Payal Bajaj and Yiqing Xie and Alvin Cheung and Jianfeng Gao and Xia Song},
year={2023},
eprint={2305.12567},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2305.12567}
}