TypeError: 'NoneType' object is not callable. While using run_clm.py, while trying to load dataset.
### System Info

```
- `transformers` version: 4.26.1
- Platform: Linux-6.0.0-6-amd64-x86_64-with-glibc2.36
- Python version: 3.9.12
- Huggingface_hub version: 0.12.0
- PyTorch version (GPU?): 1.13.1+cu117 (True)
- Tensorflow version (GPU?): 2.11.0 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No
```

Trace:
```
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│run_clm.py:621 in <module>                 │
│                                                                                                  │
│   618                                                                                            │
│   619                                                                                            │
│   620 if __name__ == "__main__":                                                                 │
│ ❱ 621 │   main()                                                                                 │
│   622                                                                                            │
│                                                                                                  │
│run_clm.py:286 in main                     │
│                                                                                                  │
│   283 │   # download the dataset.                                                                │
│   284 │   if data_args.dataset_name is not None:                                                 │
│   285 │   │   # Downloading and loading a dataset from the hub.                                  │
│ ❱ 286 │   │   raw_datasets = load_dataset(                                                       │
│   287 │   │   │   data_args.dataset_name,                                                        │
│   288 │   │   │   data_args.dataset_config_name,                                                 │
│   289 │   │   │   cache_dir=model_args.cache_dir,                                                │
│                                                                                                  │
│ anaconda3/lib/python3.9/site-packages/datasets/load.py:1735 in load_dataset          │
│                                                                                                  │
│   1732 │   ignore_verifications = ignore_verifications or save_infos                             │
│   1733 │                                                                                         │
│   1734 │   # Create a dataset builder                                                            │
│ ❱ 1735 │   builder_instance = load_dataset_builder(                                              │
│   1736 │   │   path=path,                                                                        │
│   1737 │   │   name=name,                                                                        │
│   1738 │   │   data_dir=data_dir,                                                                │
│                                                                                                  │
│ anaconda3/lib/python3.9/site-packages/datasets/load.py:1519 in load_dataset_builder  │
│                                                                                                  │
│   1516 │   │   raise ValueError(error_msg)                                                       │
│   1517 │                                                                                         │
│   1518 │   # Instantiate the dataset builder                                                     │
│ ❱ 1519 │   builder_instance: DatasetBuilder = builder_cls(                                       │
│   1520 │   │   cache_dir=cache_dir,                                                              │
│   1521 │   │   config_name=config_name,                                                          │
│   1522 │   │   data_dir=data_dir,                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
```

### Who can help?

_No response_

### Information

- [X] The official example scripts
- [ ] 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

1. run `run_clm.py` with the following parameters.
```
--model_type gpt2 \
--output_dir ./models \
--do_train \
--learning_rate 1e-4 \
--num_train_epochs 5 \
--save_total_limit 2 \
--save_steps 2000 \
--per_gpu_train_batch_size 16 \
--seed 42 \
--validation_file test.txt \
--do_eval \
--train_file text.txt \
--dataset_name test \
--tokenizer tokeniser2.py`
```

### Expected behavior

The program does not crash.
Hi @Norfaisbest, thanks for raising this issue.

It seems this issue is arising from the dataset `test` being loaded with `load_dataset` and isn't a `transformers` issue. I would suggest trying to debug running just `load_dataset('dataset_name')` outside of the script when trying to debug. <|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.