<p dir="auto">I want to specify the generate params in the line below:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="generate(tokenized_input.input_ids,
                                     max_length=64,
                                     no_repeat_ngram_size=2,
                                     early_stopping=True,
                                     num_beams=4,
                                     num_return_sequences=3)"><pre class="notranslate"><code class="notranslate">generate(tokenized_input.input_ids,
                                     max_length=64,
                                     no_repeat_ngram_size=2,
                                     early_stopping=True,
                                     num_beams=4,
                                     num_return_sequences=3)
</code></pre></div>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/huggingface/transformers/blob/93d3fd86459eb27bc584da29a3d542817a395bca/examples/pytorch/summarization/run_summarization.py#L662">transformers/examples/pytorch/summarization/run_summarization.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 662
      in
      <a data-pjax="true" class="commit-tease-sha" href="/huggingface/transformers/commit/93d3fd86459eb27bc584da29a3d542817a395bca">93d3fd8</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L662" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="662"></td>
          <td id="LC662" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">predictions</span> <span class="pl-c1">=</span> <span class="pl-s1">tokenizer</span>.<span class="pl-en">batch_decode</span>( </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">I specified the args as following. I did not get any error, but it is still getting one sequence instead of 3 as expected.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="batch_decode(
          predict_results.predictions,
          skip_special_tokens=True,
          early_stopping=True,
          clean_up_tokenization_spaces=False,
          no_repeat_ngram_size=2,
          num_return_sequences=3
)"><pre class="notranslate"><code class="notranslate">batch_decode(
          predict_results.predictions,
          skip_special_tokens=True,
          early_stopping=True,
          clean_up_tokenization_spaces=False,
          no_repeat_ngram_size=2,
          num_return_sequences=3
)
</code></pre></div>
<h3 dir="auto">System Info</h3>
<ul dir="auto">
<li><code class="notranslate">transformers</code> version: 4.26.1</li>
<li>Platform: macOS-13.1-x86_64-i386-64bit</li>
<li>Python version: 3.9.16</li>
<li>Huggingface_hub version: 0.12.1</li>
<li>PyTorch version (GPU?): 1.13.0 (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/sanchit-gandhi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sanchit-gandhi">@sanchit-gandhi</a>  <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Narsil/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Narsil">@Narsil</a></p>
<p dir="auto">When running a simple whisper pipeline, e.g., using the options 'return_dict_in_generate': True and 'output_scores': True, e.g.,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from pathlib import Path
from transformers import pipeline, AutomaticSpeechRecognitionPipeline, Pipeline, GenerationConfig

audio_path = 'xxx.wav'

generate_kwargs = {'temperature': 1, 'max_length': 448, 'return_dict_in_generate': True, 'output_scores': True}

pipe = pipeline(
    model=&quot;openai/whisper-small&quot;,
    chunk_length_s=10,
    framework=&quot;pt&quot;,
    batch_size=1
)

print(pipe(audio_path, return_timestamps=True, generate_kwargs=generate_kwargs))"><pre class="notranslate"><code class="notranslate">from pathlib import Path
from transformers import pipeline, AutomaticSpeechRecognitionPipeline, Pipeline, GenerationConfig

audio_path = 'xxx.wav'

generate_kwargs = {'temperature': 1, 'max_length': 448, 'return_dict_in_generate': True, 'output_scores': True}

pipe = pipeline(
    model="openai/whisper-small",
    chunk_length_s=10,
    framework="pt",
    batch_size=1
)

print(pipe(audio_path, return_timestamps=True, generate_kwargs=generate_kwargs))
</code></pre></div>
<p dir="auto">I am getting the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/Users/sofia/PycharmProjects/openAI-whisper/test4.py&quot;, line 39, in &lt;module&gt;
    print(pipe(audio_path, return_timestamps=True, generate_kwargs=generate_kwargs))
  File &quot;/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/automatic_speech_recognition.py&quot;, line 378, in __call__
    return super().__call__(inputs, **kwargs)
  File &quot;/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/base.py&quot;, line 1076, in __call__
    return next(
  File &quot;/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py&quot;, line 125, in __next__
    processed = self.infer(item, **self.params)
  File &quot;/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/automatic_speech_recognition.py&quot;, line 611, in postprocess
    items = outputs[key].numpy()
AttributeError: 'ModelOutput' object has no attribute 'numpy'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/Users/sofia/PycharmProjects/openAI-whisper/test4.py", line 39, in &lt;module&gt;
    print(pipe(audio_path, return_timestamps=True, generate_kwargs=generate_kwargs))
  File "/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/automatic_speech_recognition.py", line 378, in __call__
    return super().__call__(inputs, **kwargs)
  File "/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/base.py", line 1076, in __call__
    return next(
  File "/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 125, in __next__
    processed = self.infer(item, **self.params)
  File "/Users/sofia/miniforge3/envs/openAI-whisper/lib/python3.9/site-packages/transformers/pipelines/automatic_speech_recognition.py", line 611, in postprocess
    items = outputs[key].numpy()
AttributeError: 'ModelOutput' object has no attribute 'numpy'
</code></pre></div>
<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"> 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" checked=""> My own task or dataset (give details below)</li>
</ul>
<h3 dir="auto">Reproduction</h3>
<ol dir="auto">
<li>Run the code</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from pathlib import Path
from transformers import pipeline, AutomaticSpeechRecognitionPipeline, Pipeline, GenerationConfig

audio_path = 'xxx.wav'

generate_kwargs = {'temperature': 1, 'max_length': 448, 'return_dict_in_generate': True, 'output_scores': True}

pipe = pipeline(
    model=&quot;openai/whisper-small&quot;,
    chunk_length_s=10,
    framework=&quot;pt&quot;,
    batch_size=1
)

print(pipe(audio_path, return_timestamps=True, generate_kwargs=generate_kwargs))"><pre class="notranslate"><code class="notranslate">from pathlib import Path
from transformers import pipeline, AutomaticSpeechRecognitionPipeline, Pipeline, GenerationConfig

audio_path = 'xxx.wav'

generate_kwargs = {'temperature': 1, 'max_length': 448, 'return_dict_in_generate': True, 'output_scores': True}

pipe = pipeline(
    model="openai/whisper-small",
    chunk_length_s=10,
    framework="pt",
    batch_size=1
)

print(pipe(audio_path, return_timestamps=True, generate_kwargs=generate_kwargs))
</code></pre></div>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">I expect to get the text result accompanied with the timestamps and the prediction scores</p>