[doc] gpt-neo (#11098)

make the example work
This commit is contained in:
Stas Bekman
2021-04-06 13:42:06 -07:00
committed by GitHub
parent 9853c5dd58
commit 520198f56f

View File

@@ -38,9 +38,9 @@ The :obj:`generate()` method can be used to generate text using GPT Neo model.
... "previously unexplored valley, in the Andes Mountains. Even more surprising to the " \
... "researchers was the fact that the unicorns spoke perfect English."
>>> input_ids = tokenizer(unicorns, return_tensors="pt").input_ids
>>> input_ids = tokenizer(prompt, return_tensors="pt").input_ids
>>> gen_tokens = model.generate(ids, do_sample=True, temperature=0.9, max_length=100,)
>>> gen_tokens = model.generate(input_ids, do_sample=True, temperature=0.9, max_length=100,)
>>> gen_text = tokenizer.batch_decode(gen_tokens)[0]