Skip to content

Commit 394309d

Browse files
committed
style: fix whitespace linting errors
1 parent 78c2c00 commit 394309d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/transformers/data/data_collator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ def __call__(self, features, return_tensors=None, separator_id=None):
14171417
if hasattr(input_ids, "tolist"):
14181418
input_ids = input_ids.tolist()
14191419
batch["input_ids"] += input_ids
1420-
1420+
14211421
if is_labels_provided:
14221422
labels = sample["labels"]
14231423
# Convert to list if tensor

tests/trainer/test_data_collator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,16 +1982,16 @@ def test_flattening_with_tensor_labels(self):
19821982
},
19831983
]
19841984
collator = DataCollatorWithFlattening(return_tensors="pt")
1985-
1985+
19861986
# This should not raise TypeError anymore
19871987
batch = collator(features)
1988-
1988+
19891989
# Verify the output
19901990
self.assertIsInstance(batch, dict)
19911991
self.assertIn("input_ids", batch)
19921992
self.assertIn("labels", batch)
19931993
self.assertIn("position_ids", batch)
1994-
1994+
19951995
# Check shapes
19961996
self.assertEqual(batch["input_ids"].shape, (1, 7)) # 4 + 3 tokens
19971997
self.assertEqual(batch["labels"].shape, (1, 7))
@@ -2011,7 +2011,7 @@ def test_flattening_with_list_labels(self):
20112011
]
20122012
collator = DataCollatorWithFlattening(return_tensors="pt")
20132013
batch = collator(features)
2014-
2014+
20152015
# Verify it still works with lists
20162016
self.assertIsInstance(batch, dict)
20172017
self.assertEqual(batch["input_ids"].shape, (1, 7))

0 commit comments

Comments
 (0)