File size: 488 Bytes
5fa1a76 |
1 2 3 4 5 6 7 8 9 10 |
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. |