# Output Includes Input

**URL:** <https://discuss.huggingface.co/t/output-includes-input/6831>\
**Category:** Beginners\
**Created:** [June 15, 2021, 3:24am UTC](https://discuss.huggingface.co/t/output-includes-input/6831 "2021-06-15T03:24:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurbster](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@kurbster](https://discuss.huggingface.co/u/kurbster)\
**Post date:** [June 15, 2021, 3:24am UTC](https://discuss.huggingface.co/t/output-includes-input/6831/1 "2021-06-15T03:24:55Z")

</div>

Whenever I am generating text the input is included in the output. When the input is close to the maximum length the model barely produces any useful output.

# Information

When using transformers.pipeline or transformers.from\_pretrianed, the model is only generating the input, when the input is long. For example,  
`generator = transformers.pipeline('text-generation', model='gpt2')`  
`prompt = "really long text that is 1023 tokens ..."`  
`output = generator(prompt, mex_length=1024, do_sample=True, temperature=0.9)`  
output in this case would be equal to the input prompt.

## To Reproduce

[Here is a Collab notebook](https://colab.research.google.com/drive/1JzwSmFGrWY1bU6f-t-mgMug88NsRVllp#scrollTo=OgOhZxQJNseL) with simple examples of the problem. I am looking to generate output from input ~1300 tokens and running into this issue consistently. Is there a way around this?

---

<div class="post-metadata">

**Author:** ![Skylixia](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Skylixia](https://discuss.huggingface.co/u/Skylixia)\
**Post date:** [June 16, 2021, 11:09am UTC](https://discuss.huggingface.co/t/output-includes-input/6831/2 "2021-06-16T11:09:49Z")

</div>

I am experiencing the same issue with another model … Help with this would be appreciated

---

<div class="post-metadata">

**Author:** ![anon58517992](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@anon58517992](https://discuss.huggingface.co/u/anon58517992)\
**Post date:** [November 19, 2021, 2:38pm UTC](https://discuss.huggingface.co/t/output-includes-input/6831/3 "2021-11-19T14:38:51Z")

</div>

I have the same problem with GPTJ, did you manage to fix this?

---

<div class="post-metadata">

**Author:** ![yanming](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@yanming](https://discuss.huggingface.co/u/yanming)\
**Post date:** [September 29, 2022, 2:26am UTC](https://discuss.huggingface.co/t/output-includes-input/6831/4 "2022-09-29T02:26:08Z")

</div>

The same issue for me. Had you solved it? : )
