Fix model parallelism test
# What does this PR do?

This fixes the model parallelism test for models whose config does not have a `num_hidden_layers` attribute, or if that attribute is a dict and not an int.
_The documentation is not available anymore as the PR was closed or merged._