fix: support tensor labels in DataCollatorWithFlattening (#42620)
* fix: support tensor labels in DataCollatorWithFlattening
- Add tensor to list conversion in DataCollatorWithFlattening
- Convert input_ids and labels to list if they are tensors
- Add tests for both tensor and list labels
- Fixes #42599
* style: fix whitespace linting errors
* style: apply ruff format to test file