ImportError: cannot import name 'TorchTensorParallelPlugin' from 'accelerate.utils'
Author: ibillxia
Pull request: no
Labels: name: bug

### System Info

enviorment info:

-Python 3.11.9
-pip 25.1.1
-Successfully installed hf-xet-1.1.5 huggingface-hub-0.33.1 joblib-1.5.1 opencv-python-4.11.0.86 retrying-1.4.0 scikit-learn-1.7.0 sentence-transformers-4.1.0 threadpoolctl-3.6.0 tokenizers-0.21.2 `transformers-4.53.0`

error log:

```Traceback (most recent call last):
  File "test.py", line 13, in <module>
    from sentence_transformers import SentenceTransformer
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/sentence_transformers/__init__.py", line 14, in <module>
    from sentence_transformers.cross_encoder import (
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/sentence_transformers/cross_encoder/__init__.py", line 5, in <module>
    from .trainer import CrossEncoderTrainer
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/sentence_transformers/cross_encoder/trainer.py", line 22, in <module>
    from sentence_transformers.trainer import SentenceTransformerTrainer
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/sentence_transformers/trainer.py", line 14, in <module>
    from transformers import EvalPrediction, PreTrainedTokenizerBase, Trainer, TrainerCallback
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 2154, in __getattr__
    module = self._get_module(self._class_to_module[name])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 2184, in _get_module
    raise e
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 2182, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/transformers/trainer.py", line 229, in <module>
    from accelerate.utils import (
ImportError: cannot import name 'TorchTensorParallelPlugin' from 'accelerate.utils' (/data/miniforge3/envs/env-3.11.9/lib/python3.11/site-packages/accelerate/utils/__init__.py)
```

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

only `transformers-4.53.0` failed.
when change to `transformers-4.51.0`, no errors

### Expected behavior

`from sentence_transformers import SentenceTransformer`

this import no error

Comments:
You need to upgrade your accelerate version! 🤗 cc @S1ro1

@ArthurZucker Not really, there seems to be a rogue import that isn't version checked. I'll create a PR in a moment, it's used on 1 place in trainer.py (behind version check), but imported twice (one time without version check -> causes this error)

+1 Upgrading accelerate doesnt work for me 

You need to switch to the patch version of transformers, that one contains the fix.