# How to generate one word and output it instead of all the answers at once, which would take a long time

**URL:** <https://discuss.huggingface.co/t/how-to-generate-one-word-and-output-it-instead-of-all-the-answers-at-once-which-would-take-a-long-time/50435>\
**Category:** 🤗Transformers\
**Created:** [August 11, 2023, 1:30pm UTC](https://discuss.huggingface.co/t/how-to-generate-one-word-and-output-it-instead-of-all-the-answers-at-once-which-would-take-a-long-time/50435 "2023-08-11T13:30:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![heifongni](https://avatars.discourse-cdn.com/v4/letter/h/c77e96/32.png) [@heifongni](https://discuss.huggingface.co/u/heifongni)\
**Post date:** [August 11, 2023, 1:30pm UTC](https://discuss.huggingface.co/t/how-to-generate-one-word-and-output-it-instead-of-all-the-answers-at-once-which-would-take-a-long-time/50435/1 "2023-08-11T13:30:08Z")

</div>

pipe = pipeline(“text-generation”, model=checkpoint, model\_kwargs = {“load\_in\_8bit”:True}, device\_map=“auto”)  
outputs = pipe(prompt, max\_new\_tokens=1024, do\_sample=True, temperature=0.2, top\_k=50, top\_p=0.95, eos\_token\_id=49155, pad\_token\_id=49155)

how can i do for my code
