# Output Includes Input

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foutput-includes-input%2F6831%3E%5C
**Category:** Beginners\
**Created:** [June 15, 2021, 3:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foutput-includes-input%2F6831 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkurbster)%5C
**Post date:** [June 15, 2021, 3:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foutput-includes-input%2F6831%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSkylixia)%5C
**Post date:** [June 16, 2021, 11:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foutput-includes-input%2F6831%2F2 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fanon58517992)%5C
**Post date:** [November 19, 2021, 2:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foutput-includes-input%2F6831%2F3 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fyanming)%5C
**Post date:** [September 29, 2022, 2:26am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foutput-includes-input%2F6831%2F4 "2022-09-29T02:26:08Z")

</div>

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