[AutoModel] fix `torch_dtype=auto` in `from_pretrained` (#23379)
* [automodel] fix torch_dtype=auto in from_pretrained
* add test
* fix logic
* Update src/transformers/models/auto/auto_factory.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
---------
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>