[bugfix] Loading sharded model with torch_dtype='auto' causes TypeError
# What does this PR do?

Fixes #18314

## Before submitting
- [n] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [y] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [n] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [na] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [n] Did you write any new necessary tests?

## Who can review?

Anyone can review as it is a very small bugfix, but I will tag @sgugger based on git blame.
_The documentation is not available anymore as the PR was closed or merged._<|||||>Hi there, thanks for the fix! This is a duplicate of #18061 so we will merge this one as it came first :-)<|||||>Hi. Sorry for dup and thanks for the fix! I am closing this PR (and the issue) as it is no longer necessary.