Unverified Commit 18a0150b authored by Zihao Fu's avatar Zihao Fu Committed by GitHub
Browse files

fix bart doc (#5132)

fix bart doc
parent 3fe75c7f
...@@ -60,8 +60,8 @@ BART_GENERATION_EXAMPLE = r""" ...@@ -60,8 +60,8 @@ BART_GENERATION_EXAMPLE = r"""
from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
# see ``examples/summarization/bart/run_eval.py`` for a longer example # see ``examples/summarization/bart/run_eval.py`` for a longer example
model = BartForConditionalGeneration.from_pretrained('bart-large-cnn') model = BartForConditionalGeneration.from_pretrained('facebook/bart-large-cnn')
tokenizer = BartTokenizer.from_pretrained('bart-large-cnn') tokenizer = BartTokenizer.from_pretrained('facebook/bart-large-cnn')
ARTICLE_TO_SUMMARIZE = "My friends are cool but they eat too many carbs." ARTICLE_TO_SUMMARIZE = "My friends are cool but they eat too many carbs."
inputs = tokenizer.batch_encode_plus([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='pt') inputs = tokenizer.batch_encode_plus([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors='pt')
# Generate Summary # Generate Summary
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment