# Whisper warning about not predicting end of a timestamp

**URL:** <https://discuss.huggingface.co/t/whisper-warning-about-not-predicting-end-of-a-timestamp/79129>\
**Category:** 🤗Transformers\
**Created:** [March 28, 2024, 1:05pm UTC](https://discuss.huggingface.co/t/whisper-warning-about-not-predicting-end-of-a-timestamp/79129 "2024-03-28T13:05:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flabbaf97](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@flabbaf97](https://discuss.huggingface.co/u/flabbaf97)\
**Post date:** [March 28, 2024, 1:05pm UTC](https://discuss.huggingface.co/t/whisper-warning-about-not-predicting-end-of-a-timestamp/79129/1 "2024-03-28T13:05:45Z")

</div>

Hi everyone.  
I want to use whisper to do speech recognition on one minutes voices. every thing is fine, but I get this warning:

```auto
Whisper did not predict an ending timestamp which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.

```

Firs of all: what is `WhisperTimeStampLogitsProcessor`? I couldn’t find it in any documentation.  
Secondly, Can this affect the performance of speech recognition? How do I fix it? What things I can try?  
From the voices, the end of speech is very clear.

Here are the codes that led to this warning message?

```auto
def load_model(model_id: str) -> None:
    device = "cuda:0" if torch.cuda.is_available() else "cpu"
    torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
    model = AutoModelForSpeechSeq2Seq.from_pretrained(
        model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
    )
    model.to(device)

    processor = AutoProcessor.from_pretrained(model_id)

    pipe = pipeline(
        "automatic-speech-recognition",
        model=model,
        tokenizer=processor.tokenizer,
        feature_extractor=processor.feature_extractor,
        max_new_tokens=128,
        chunk_length_s=30,
        batch_size=16,
        return_timestamps=True,
        torch_dtype=torch_dtype,
        device=device,
    )
    return pipe
def batch_transcribe(file_addresses: list[str], pipe: pipeline, language: str) -> tuple:
    dataset = AudioDataset(file_addresses, language)
    dataloader = DataLoader(dataset, batch_size=16, shuffle=False)

    text_results = []
    raw_results = []

    for batch_file_addresses in tqdm.tqdm(dataloader):
        batch_res = pipe(batch_file_addresses,return_timestamps="word", generate_kwargs={"language": language})
        for res, file_address in zip(batch_res, batch_file_addresses):
            res['file_address'] = file_address
            res['language'] = language
            raw_results.append(res)
            text_results.append(res['text'])
    return (raw_results, text_results)

def transcribe_audio(audio_file: str, pipe: pipeline, language: str) -> dict:
    result = pipe(audio_file, return_timestamps=True, generate_kwargs={"language": language}) 
    return result

model = "openai/whisper-large"
pipe = load_model(model)
tmp_detail = metadata.loc[metadata['language'] == language].copy()
(raw_results , text_results) = batch_transcribe(dataset[language], pipe, language=language_map[language])

```

Any discussion or suggestion is welcome about this topic. I’d like to know why might this happen and what effects can it have.

---

<div class="post-metadata">

**Author:** ![cookiefox387](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cookiefox387](https://discuss.huggingface.co/u/cookiefox387)\
**Post date:** [June 20, 2025, 5:28pm UTC](https://discuss.huggingface.co/t/whisper-warning-about-not-predicting-end-of-a-timestamp/79129/2 "2025-06-20T17:28:40Z")

</div>

I’m having the same problem. Have you found a resolution?

---

<div class="post-metadata">

**Author:** ![akashkriplani](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@akashkriplani](https://discuss.huggingface.co/u/akashkriplani)\
**Post date:** [September 15, 2025, 4:24pm UTC](https://discuss.huggingface.co/t/whisper-warning-about-not-predicting-end-of-a-timestamp/79129/3 "2025-09-15T16:24:05Z")

</div>

Any luck? Were you able to solve this? @flabbaf97

---

<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:** [September 16, 2025, 3:03am UTC](https://discuss.huggingface.co/t/whisper-warning-about-not-predicting-end-of-a-timestamp/79129/4 "2025-09-16T03:03:48Z")

</div>

It [seems to be a class specific to Hugging Face Transformers](https://huggingface.co/datasets/John6666/forum1/blob/main/whisper_timestamp_warning.md).
