thon | |
from transformers import AutoTokenizer, EncoderDecoderModel | |
load a fine-tuned seq2seq model and corresponding tokenizer | |
model = EncoderDecoderModel.from_pretrained("patrickvonplaten/bert2bert_cnn_daily_mail") | |
tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/bert2bert_cnn_daily_mail") | |
let's perform inference on a long piece of text | |
ARTICLE_TO_SUMMARIZE = ( | |
"PG&E stated it scheduled the blackouts in response to forecasts for high winds " | |
"amid dry conditions. |