transformers
5f8ab9bb - Fix incorrect tuple return annotations on forward methods returning a Tensor (#48359)

Commit
58 days ago
Fix incorrect tuple return annotations on forward methods returning a Tensor (#48359) A number of `forward` methods declare a `tuple[...]` return annotation but return a bare `torch.Tensor`. Same class of issue as #45208, fixed for `Qwen3MoeSparseMoeBlock` in #45352. Each of the 29 classes touched here was instantiated and called with a minimal config, and the returned object's type observed to be `torch.Tensor`. Annotation only: no runtime behaviour is affected. Eleven annotations were edited in `modular_*.py` sources and the corresponding `modeling_*.py` files regenerated with `utils/modular_model_converter.py`; `utils/check_modular_conversion.py` and `utils/check_copies.py` both pass. Co-authored-by: Gustavo <gustavo.vp350@gmail.com>
Author
Parents
Loading