🐛 `model_init` fails when its a partially evaluated funtion.
https://github.com/huggingface/transformers/blob/65e27215ba991450e30aac1bf06f7f4e889e77fb/src/transformers/trainer.py#L908

Inspect module usage here does not take into account the cases when the user provides a partially evaluated function, causing an exception.

Since the issue is related to the `trainer` API I tag you @sgugger 

Example:

```python
import functools
import inspect

checkpoint = "..."
fn = lambda: AutoModel.from_pretrained(checkpoint )
print(len(inspect.signature(fn).parameters))
# Outpus: 0, then no trial expected everything works fine 

def fn1(model_base_checkpoint):
  return AutoModel.from_pretrained(model_base_checkpoint)

model_init_fn = functools.partial(fn1, model_base_checkpoint=checkpoint )
print(len(inspect.signature(fn).parameters))
# Outputs 1, then the call_model_init tries to pass the ray or optuna trial which results in
# model_init() got multiple values for argument 'model_base_checkpoint' exception
```
I can reproduce. I would argue that this is more a bug in Python than the `Trainer` but will try to find a way to fix this. In the meantime, you should avoid using partials for `model_init` :-)<|||||>Thanks for the quick answer! I'll avoid using partials for now 👍🏼<|||||>Should be fixed in the PR above!