Allow the use of tensorflow datasets having UNKNOWN_CARDINALTY for TFTrainer
# 🚀 Feature request
<!-- A clear and concise description of the feature proposal.
     Please provide a link to the paper and code in case they exist. -->

I am currently working on a project which requires huggingface and tensorflow. I created a huggingface dataset and converted it into tensorflow dataset using `from_generator()`, instead of `from_tensor_slices()` like the example in the docs. The dataset that I am using is very big, hence, it takes a lot of time for it to get converted into a tensor using dictionary comprehension. `from_generator()` handles this well by processing the data on-the-fly. Tensorflow allows training via datasets having UNKNOWN_CARDINALITY. I would like to suggest the same to be implemented in TFTrainer.

Hi! We're actually trying to deprecate the use of TFTrainer at the moment in favour of Keras - there will be a deprecation warning about this in the next release of Transformers. Using Keras you can train with a generator or tf.data.Dataset without problems.

In addition, we're looking to improve our Tensorflow integration in other ways, such as by making it easier to load huggingface datasets as Tensorflow datasets, which might allow us to retain the cardinality information regardless. This second part is still a work in progress, though!<|||||>> Hi! We're actually trying to deprecate the use of TFTrainer at the moment in favour of Keras - there will be a deprecation warning about this in the next release of Transformers. Using Keras you can train with a generator or tf.data.Dataset without problems.
> 
> In addition, we're looking to improve our Tensorflow integration in other ways, such as by making it easier to load huggingface datasets as Tensorflow datasets, which might allow us to retain the cardinality information regardless. This second part is still a work in progress, though!

That's great! Looking forward to the next release!:smile:<|||||>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/master/CONTRIBUTING.md) are likely to be ignored.