# Inference API error with Whisper, return\_timestamps parameter

**URL:** <https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043>\
**Category:** Inference Endpoints on the Hub\
**Created:** [April 12, 2025, 2:08am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043 "2025-04-12T02:08:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![oslv](https://avatars.discourse-cdn.com/v4/letter/o/a3d4f5/32.png) [@oslv](https://discuss.huggingface.co/u/oslv)\
**Post date:** [April 12, 2025, 2:08am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/1 "2025-04-12T02:08:35Z")

</div>

Hi team, been using the inference endpoint for whisper for months at [https://api-inference.huggingface.co/models/openai/whisper-large-v3-turbo](https://api-inference.huggingface.co/models/openai/whisper-large-v3-turbo). Today, all of a sudden, the API started throwing this error

```auto
'You have passed more than 3000 mel input features (> 30 seconds) which automatically enables long-form generation which requires the model to predict timestamp tokens. Please either pass `return_timestamps=True` or make sure to pass no more than 3000 mel input features.', 'warnings': ['There was an inference error: You have passed more than 3000 mel input features (> 30 seconds) which automatically enables long-form generation which requires the model to predict timestamp tokens. Please either pass `return_timestamps=True` or make sure to pass no more than 3000 mel input features.

```

I tried passing the parameter in multiple ways

```auto
parameters = {
    "language": "en",
    "temperature": "0.0",
    "return_timestamps": "true",

```

also using 1, True (boolean), “True” But the error still comes up. I am also able to see the error on the UI playground at [openai/whisper-large-v3-turbo · Hugging Face](https://huggingface.co/openai/whisper-large-v3-turbo) : Did anyone see similar behaviour ? Can the team please help on this ? Many thanks

 ![Image](https://us1.discourse-cdn.com/hellohellohello/original/3X/6/7/67f70b7f8251fb8e1d8159fc6fb624291a8a89ea.jpeg)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 12, 2025, 6:29am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/2 "2025-04-12T06:29:49Z")

</div>

Hmm, I tried it with the wav file I found, and it seems to work for the moment.

> **[openai/whisper-large-v3-turbo · Hugging Face](https://huggingface.co/openai/whisper-large-v3-turbo)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

 ![whisperapi1](https://us1.discourse-cdn.com/hellohellohello/original/3X/3/7/37ddeb333302ca72bc1229960b4bc702957fc849.png)

---

<div class="post-metadata">

**Author:** ![mahmutc](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mahmutc/32/52583_2.png) [@mahmutc](https://discuss.huggingface.co/u/mahmutc)\
**Post date:** [April 12, 2025, 6:50am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/3 "2025-04-12T06:50:49Z")

</div>

The issue is related to file length. WAV files longer than 30 seconds trigger the error.

---

<div class="post-metadata">

**Author:** ![TOOTHED](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/toothed/32/47096_2.png) [@TOOTHED](https://discuss.huggingface.co/u/TOOTHED)\
**Post date:** [April 13, 2025, 4:46pm UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/4 "2025-04-13T16:46:37Z")

</div>

I also faced the same problem (whisper-large-v3-turbo, ogg audio). Until yesterday it was working fine, but now audio \>30s causing error, return\_timestamps does not help as well. Same issue on whisper-large-v3

---

<div class="post-metadata">

**Author:** ![oslv](https://avatars.discourse-cdn.com/v4/letter/o/a3d4f5/32.png) [@oslv](https://discuss.huggingface.co/u/oslv)\
**Post date:** [April 13, 2025, 9:12pm UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/5 "2025-04-13T21:12:34Z")

</div>

I agree with @TOOTHED - seeing same behaviour here. Files \>30 s used to work without any issues but now throw an error, and no keyword/param works, should this be raised with the API team somehow ?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 14, 2025, 1:32am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/6 "2025-04-14T01:32:59Z")

</div>

I think we can contact the Hugging Face team from any of these. The Hugging Face functions are managed on github with the exception of a few, so raising an issue on github is the most reliable way to get in touch. However, there are so many github pages that it’s hard to know where to write…😅

### Hugging Face Documents and Hub general issue

> **[huggingface/hub-docs](https://github.com/huggingface/hub-docs/issues)**
>
> Docs of the Hugging Face Hub. Contribute to huggingface/hub-docs development by creating an account on GitHub.

### Library handling Inference API

> **[huggingface/text-generation-inference](https://github.com/huggingface/text-generation-inference/issues)**
>
> Large Language Model Text Generation Inference. Contribute to huggingface/text-generation-inference development by creating an account on GitHub.

### Whisper Class (Maybe it’s different this time…)

> **[huggingface/transformers](https://github.com/huggingface/transformers/issues)**
>
> 🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training. - huggingface/transformers

---

<div class="post-metadata">

**Author:** ![TOOTHED](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/toothed/32/47096_2.png) [@TOOTHED](https://discuss.huggingface.co/u/TOOTHED)\
**Post date:** [April 14, 2025, 3:47pm UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/7 "2025-04-14T15:47:15Z")

</div>

Well, tbh it is literally my first comment on hf forums, so I am not sure how it is working here. But overall, yes, as whisper models were not updated and this behaviour is similar for all them, the error is for sure caused by the updates in hugging face API - either AutomaticSpeechRecognition method (i didn’t test if any parameters work), or something deeper

---

<div class="post-metadata">

**Author:** ![oslv](https://avatars.discourse-cdn.com/v4/letter/o/a3d4f5/32.png) [@oslv](https://discuss.huggingface.co/u/oslv)\
**Post date:** [April 18, 2025, 2:45am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/8 "2025-04-18T02:45:17Z")

</div>

I have now cross-posted this in three different places - wondering if someone knows how to tag someone from the dev/support team. I feel like this is part of the broader inference api changes, the behaviour of this whisper endpoint has radically changed and is barely usable - the silence from the team on all open issues here is somewhat worrying.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 18, 2025, 3:03am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/9 "2025-04-18T03:03:23Z")

</div>

> <https://github.com/huggingface/hub-docs/issues/1694>
>
> \*\*Bug description.\*\*
> Hi team, been using the inference endpoint for whisper for …months at https://api-inference.huggingface.co/models/openai/whisper-large-v3-turbo. Today, all of a sudden, the API started throwing this error
> 
> \> You have passed more than 3000 mel input features (\> 30 seconds) which automatically enables long-form generation which requires the model to predict timestamp tokens. Please either pass \`return\_timestamps=True\` or make sure to pass no more than 3000 mel input features.', 'warnings': \['There was an inference error: You have passed more than 3000 mel input features (\> 30 seconds) which automatically enables long-form generation which requires the model to predict timestamp tokens. Please either pass \`return\_timestamps=True\` or make sure to pass no more than 3000 mel input features.
> 
> This of course only happens when passing in samples longer than 30 seconds, and is replicable through the UI. 
> 
> Passing a \`return\_timestamp\` parameter in the HTTP request does not solve the issue, either in boolean or string form (True/"true")
> 
> \`parameters = {
> "language": "en",
> "temperature": "0.0",
> "return\_timestamps": True}\` 
> 
> Using \`generation\_params\` also fails here. 
> 
> \*\*Describe the expected behaviour\*\*
> The endpoint should run inference as it has previously. Samples exceeding 30 seconds were supported without any issues and no parameter had to be provided. 
> 
> !\[Image\](https://github.com/user-attachments/assets/efb8aa59-be1e-4c64-a240-8351ccd9ee76)

Hmm, I only know the staff who are visible…

If it’s related to Whisper, Serverless Inference API, or servers, then _michellehbn_, _Wauplin_, _pierric_, or _victor_?  
You could also ask _meganariley_…  
The last resort is _julien-c_.

> [@500 Internal Error - We're working hard to fix this as soon as possible](https://discuss.huggingface.co/t/500-internal-error-were-working-hard-to-fix-this-as-soon-as-possible/150333/28):
>
> Hi everyone, thanks for reporting. We’re investigating and we’ll get back to you all real soon. Thanks in advance for bearing with us hugs

---

<div class="post-metadata">

**Author:** ![oslv](https://avatars.discourse-cdn.com/v4/letter/o/a3d4f5/32.png) [@oslv](https://discuss.huggingface.co/u/oslv)\
**Post date:** [April 18, 2025, 3:16am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/10 "2025-04-18T03:16:22Z")

</div>

Thanks @John6666 !

@michellehbn - tagging here as this might be related to the broader inference API issues

---

<div class="post-metadata">

**Author:** ![Haddad308](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/haddad308/32/45958_2.png) [@Haddad308](https://discuss.huggingface.co/u/Haddad308)\
**Post date:** [April 20, 2025, 12:21pm UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/11 "2025-04-20T12:21:25Z")

</div>

Is there are any replacement for this model ?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 20, 2025, 12:57pm UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/12 "2025-04-20T12:57:17Z")

</div>

Maybe something like FastRTC. But the application may be a little different.

> **[Spaces - Hugging Face](https://huggingface.co/spaces?sort=trending&search=asr)**
>
> Discover amazing ML apps made by the community

> **[FastRTC: The Real-Time Communication Library for Python](https://huggingface.co/blog/fastrtc)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![TOOTHED](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/toothed/32/47096_2.png) [@TOOTHED](https://discuss.huggingface.co/u/TOOTHED)\
**Post date:** [April 25, 2025, 3:29am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/13 "2025-04-25T03:29:51Z")

</div>

Right now the problem was finally solved - it is working correctly on the HF website and with API request.

_ **However** _ another change appears in API: **no more Auto-detection of audio format, content-type needs to be explitely stated**. Briefly in my case: previously I could pass the “application/octet-stream” type (raw bytes) and HF would auto detect it as OGG. But now it causes error “Content type “None” not supported.” . So the solution is to explitely state that it is “audio/ogg” content-type.

I believe in raw API request it was always the case, but I used _huggingface.js Inference Client_ which did not require explicit content-type before.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 25, 2025, 7:31am UTC](https://discuss.huggingface.co/t/inference-api-error-with-whisper-return-timestamps-parameter/150043/14 "2025-04-25T07:31:33Z")

</div>

I found a change that seems to be “it.” (I’m not sure if it really is, though…)

> **[Release Inference 2.0 · huggingface/huggingface.js](https://github.com/huggingface/huggingface.js/releases/tag/inference-v2.0.0)**
>
> The main features for this release are:
> 
> Support for Inference endpoints! credits to @vvmnnnkv
> Custom requests via request and streamingRequest
> Possibility to import the methods directly without th...

> **[Issues · huggingface/huggingface.js](https://github.com/huggingface/huggingface.js/issues)**
>
> Utilities to use the Hugging Face Hub API. Contribute to huggingface/huggingface.js development by creating an account on GitHub.
