<h3 dir="auto">System Info</h3>
<p dir="auto">transformers version: 4.17.0<br>
Python version: 3.7.0<br>
torch version: 1.10.1</p>
<h3 dir="auto">Who can help?</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Information</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The official example scripts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own modified scripts</li>
</ul>
<h3 dir="auto">Tasks</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> An officially supported task in the <code class="notranslate">examples</code> folder (such as GLUE/SQuAD, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own task or dataset (give details below)</li>
</ul>
<h3 dir="auto">Reproduction</h3>
<p dir="auto">CLIP(<a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text">https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text</a>).</p>
<p dir="auto">I have implemented a Dataset to train, but i have found that after each epoch the training loss will drop suddenly. The Dataset overrides three methods(<strong>init</strong>, <strong>getitem</strong> and <strong>len</strong>) and i couldn't figure out the reason for the  above phenomenon.</p>
<p dir="auto">I think the data is shuffled properly(checked) and the learning_rate drops smoothly(observed).<br>
I would appreciate it if you could afford time to help me.</p>
<p dir="auto">The picture is drawn according to the trainer_state.json</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/27990344/186142292-6c3d4a56-9c9e-45b2-a139-1668b995e59b.png"><img width="1108" alt="image" src="https://user-images.githubusercontent.com/27990344/186142292-6c3d4a56-9c9e-45b2-a139-1668b995e59b.png" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Figure out the reason.</p>
<h3 dir="auto">System Info</h3>
<ul dir="auto">
<li><code class="notranslate">transformers</code> version: 4.27.0.dev0</li>
<li>Platform: Windows-10-10.0.19044-SP0</li>
<li>Python version: 3.10.4</li>
<li>Huggingface_hub version: 0.12.0</li>
<li>PyTorch version (GPU?): 1.13.1+cpu (False)</li>
<li>Tensorflow version (GPU?): not installed (NA)</li>
<li>Flax version (CPU?/GPU?/TPU?): not installed (NA)</li>
<li>Jax version: not installed</li>
<li>JaxLib version: not installed</li>
<li>Using GPU in script?: No</li>
<li>Using distributed or parallel set-up in script?: No</li>
</ul>
<h3 dir="auto">Who can help?</h3>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gante/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gante">@gante</a> I believe.</p>
<h3 dir="auto">Information</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The official example scripts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> My own modified scripts</li>
</ul>
<h3 dir="auto">Tasks</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> An officially supported task in the <code class="notranslate">examples</code> folder (such as GLUE/SQuAD, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own task or dataset (give details below)</li>
</ul>
<h3 dir="auto">Reproduction</h3>
<ol dir="auto">
<li>Install transformers</li>
<li>Run the following script</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from transformers import pipeline

summarizer = pipeline(&quot;summarization&quot;, max_new_tokens=50)

prompt = &quot;text to summarize&quot;
summary = summarizer(prompt)"><pre class="notranslate"><code class="notranslate">from transformers import pipeline

summarizer = pipeline("summarization", max_new_tokens=50)

prompt = "text to summarize"
summary = summarizer(prompt)
</code></pre></div>
<ol start="3" dir="auto">
<li>It crashes with the following error:</li>
</ol>
<blockquote>
<p dir="auto">ValueError: Both <code class="notranslate">max_new_tokens</code> and <code class="notranslate">max_length</code> have been set but they serve the same purpose -- setting a limit to the generated output length. Remove one of those arguments. Please refer to the documentation for more information. (<a href="https://huggingface.co/docs/transformers/main/en/main_classes/text_generation" rel="nofollow">https://huggingface.co/docs/transformers/main/en/main_classes/text_generation</a>)</p>
</blockquote>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Expected behavior is that the script should run. I only set <code class="notranslate">max_new_tokens</code> and not <code class="notranslate">max_length</code>.<br>
This might seem like a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1510361311" data-permission-text="Title is private" data-url="https://github.com/huggingface/transformers/issues/20894" data-hovercard-type="issue" data-hovercard-url="/huggingface/transformers/issues/20894/hovercard" href="https://github.com/huggingface/transformers/issues/20894">#20894</a> but the issue persists even after installing the latest version of transformers with the fix for that issue.</p>