[DocTests] Fix some doc tests (#16889)

* [DocTests] Fix some doc tests

* hacky fix

* correct
This commit is contained in:
Patrick von Platen
2022-04-23 08:40:14 +02:00
committed by GitHub
parent 22fc93c4d9
commit 72728be3db
3 changed files with 7 additions and 8 deletions

View File

@@ -252,10 +252,9 @@ The example above only shows a single example. You can also do batched inference
>>> model = T5ForConditionalGeneration.from_pretrained("t5-small")
>>> task_prefix = "translate English to German: "
>>> sentences = [
... "The house is wonderful.",
... "I like to work in NYC.",
>>> ] # use different length sentences to test batching
>>> # use different length sentences to test batching
>>> sentences = ["The house is wonderful.", "I like to work in NYC."]
>>> inputs = tokenizer([task_prefix + sentence for sentence in sentences], return_tensors="pt", padding=True)
>>> output_sequences = model.generate(