fix trainer slow tests related to hyperparam search
# What does this PR do?
1. With the Accelerate integration in Trainer, Hyperparam Search tests were failing. This PR fixes it.

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