Fix  when Accelerate is not installed
# What does this PR do?

As pointed out in #17516, the current `from_pretrained` on the main branch tries to use a function in Accelerate even if it's not necessary. This PR adds a check on the offloading (which requires Accelerate and is enforced at [this line](https://github.com/huggingface/transformers/blob/58fb3c9f98877bf76efb03e376a5c92cf80f7952/src/transformers/modeling_utils.py#L1847) since it requires a `device_map`) before using that function.

Fixes #17516
_The documentation is not available anymore as the PR was closed or merged._