`from_config` errors for `bigcode/santacoder`
### System Info

transformers commit (current main branch): c34a525d2

### Who can help?

@sgugger 

### Information

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

### Tasks

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

### Reproduction

```
from transformers import AutoConfig, AutoModelForCausalLM
model_name = "bigcode/santacoder"
config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_config(config, trust_remote_code=True)
```

gives error:
```
Exception has occurred: ValueError
not enough values to unpack (expected 2, got 1)
  File "/fsx/kunhao/transformers/src/transformers/dynamic_module_utils.py", line 408, in get_class_from_dynamic_module
    module_file, class_name = class_reference.split(".")
  File "/fsx/kunhao/transformers/src/transformers/models/auto/auto_factory.py", line 411, in from_config
    model_class = get_class_from_dynamic_module(repo_id, module_file + ".py", class_name, **kwargs)
ValueError: not enough values to unpack (expected 2, got 1)
```
However, directly calling `model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)` works fine.

### Expected behavior

No error happens
Not an expert but I feel like we could do something here https://github.com/huggingface/transformers/blob/main/src/transformers/models/auto/auto_factory.py#L410-L411

```diff
            class_ref = config.auto_map[cls.__name__]
            if "--" in class_ref:
                repo_id, class_ref = class_ref.split("--")
            else:
                repo_id = config.name_or_path
-           module_file, class_name = class_ref.split(".")
-           model_class = get_class_from_dynamic_module(repo_id, module_file + ".py", class_name, **kwargs)
+           model_class = get_class_from_dynamic_module(class_ref, repo_id, **kwargs)
```<|||||>Sounds like the right fix if you want to make a quick PR!