GitHub Repo
Transformers Community Reports Whisper Timestamp Decoding Bug That May Merge Batch Results or Raise an Exception
A development-branch reproduction on October 7 suggests Whisper timestamp decoding may mishandle the two-dimensional tensors returned by `generate`, merging batch results or failing at runtime. The report includes a minimal reproduction, but the impact on released versions and any upstream fix remain unconfirmed.

The Hugging Face Transformers community reported on October 7 that Whisper’s batch_decode(..., decode_with_timestamps=True) handles input containers inconsistently: the same tokens decode one by one when passed as nested Python lists, but as a two-dimensional PyTorch tensor they may be concatenated into a single result or trigger an exception. The report used commit a96730c from the main branch that day, on macOS arm64, and says the same behavior also occurs on Linux x86_64. Issue report
The minimal case only requires loading the openai/whisper-tiny processor and constructing timestamp and text tokens; it does not require running the full speech model. A tensor containing three rows, each with one timestamp token, returns a single string. When each row contains multiple tokens, decoding raises an “Boolean value of Tensor is ambiguous” error. The report also provides an end-to-end call path from generate(..., return_timestamps=True) to batch decoding. Reproduction code
According to the reporter’s analysis, the Whisper decoder recognizes a batch only when the input is a “list of lists.” A two-dimensional tensor therefore enters the single-sequence path, where the timestamp loop reads an entire row rather than an individual token: rows of length one pass the comparison and are concatenated, while longer rows trigger an exception. The official documentation lists tensors and NumPy arrays as accepted input types for batch_decode, and explains that the timestamp option preserves timing information in the text. This makes the container discrepancy an API compatibility issue worth investigating. Whisper documentation
For batch subtitle or speech-data pipelines, the output count is worth checking: in addition to catching exceptions, verify that each input still has a corresponding result. Based on the list-based comparison in the report, converting inputs to nested lists may serve as a temporary workaround, but it should be validated against your own version. The report says the path without timestamps is unaffected. The issue page currently has no maintainer confirmation or linked fix, so it does not establish that all released versions are affected. Follow-up should track a type-normalization fix and batch regression tests for tensors, arrays, and lists. Scope and status