DataCollatorWithPadding: TypeError
{'login': 'RajkumarGalaxy', 'id': 59993678, 'node_id': 'MDQ6VXNlcjU5OTkzNjc4', 'avatar_url': 'https://avatars.githubusercontent.com/u/59993678?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/RajkumarGalaxy', 'html_url': 'https://github.com/RajkumarGalaxy', 'followers_url': 'https://api.github.com/users/RajkumarGalaxy/followers', 'following_url': 'https://api.github.com/users/RajkumarGalaxy/following{/other_user}', 'gists_url': 'https://api.github.com/users/RajkumarGalaxy/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/RajkumarGalaxy/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/RajkumarGalaxy/subscriptions', 'organizations_url': 'https://api.github.com/users/RajkumarGalaxy/orgs', 'repos_url': 'https://api.github.com/users/RajkumarGalaxy/repos', 'events_url': 'https://api.github.com/users/RajkumarGalaxy/events{/privacy}', 'received_events_url': 'https://api.github.com/users/RajkumarGalaxy/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892857, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODU3', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/bug', 'name': 'bug', 'color': 'd73a4a', 'default': True, 'description': "Something isn't working"}]
[]
['\r\n> \r\n> Input:\r\n> \r\n> ```\r\n> tokenizer = AutoTokenizer.from_pretrained(checkpoint)\r\n> data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors="tf")\r\n> ```\r\n> \r\n> Output:\r\n> \r\n> ```\r\n> TypeError                                 Traceback (most recent call last)\r\n> /tmp/ipykernel_42/1563280798.py in <module>\r\n>       1 checkpoint = \'bert-base-uncased\'\r\n>       2 tokenizer = AutoTokenizer.from_pretrained(checkpoint)\r\n> ----> 3 data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors="pt")\r\n> TypeError: __init__() got an unexpected keyword argument \'return_tensors\'\r\n> ```\r\n> \r\n\r\nThe issue is due to the older version of transformers and datasets. It has been resolved by upgrading their versions.\r\n\r\n`# upgrade transformers and datasets to latest versions`\r\n`!pip install --upgrade transformers`\r\n`!pip install --upgrade datasets`\r\n\r\nCheers!']
Hi,
I am following the HuggingFace course. I am now at Fine-tuning [https://huggingface.co/course/chapter3/3?fw=tf](https://huggingface.co/course/chapter3/3?fw=tf).  When I set up `DataCollatorWithPadding` as following I got an error while trying to reproduce the course code in Kaggle. This error occurs with either a CPU-only-device or a GPU-device.

Input:
```checkpoint = 'bert-base-uncased'
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors="tf")
```

Output:
```---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_42/1563280798.py in <module>
      1 checkpoint = 'bert-base-uncased'
      2 tokenizer = AutoTokenizer.from_pretrained(checkpoint)
----> 3 data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors="pt")
TypeError: __init__() got an unexpected keyword argument 'return_tensors'
```

When I call `help` method, it too confirms that there is no argument `return_tensors`.
Input:
```
help(DataCollatorWithPadding.__init__)
```
Output:
```
Help on function __init__ in module transformers.data.data_collator:

__init__(self, tokenizer: transformers.tokenization_utils_base.PreTrainedTokenizerBase, padding: Union[bool, str, transformers.file_utils.PaddingStrategy] = True, max_length: Union[int, NoneType] = None, pad_to_multiple_of: Union[int, NoneType] = None) -> None
```

But, the source file *[Data Collator - docs](https://huggingface.co/transformers/main_classes/data_collator.html#datacollatorwithpadding)* says that there is such an argument. By default, it returns Pytorch tensors while I need TF tensors.

Where do I miss?
Please help me.
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3303/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}