Better messaging and fix for incorrect shape when collating data. (#18119)
Better messaging and fix for incorrect shape when collating data. (#18119)

* More informative error message

* raise dynamic error

* remove_excess_nesting application

* incorrect shape assertion for collator & function to remove excess nesting from DatasetDict

* formatting

* eliminating datasets import

* removed and relocated remove_excess_nesting to the datasets library and updated docs accordingly

* independent assert instructions

* inform user of excess nesting
huggingface/transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers