-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Description
System Info
Transformers v4.41.2
Python v3.11.9
Linux (wsl2)
Discovered when finetuning phi3-mini-128k-instruct and doing custom masking of the dataset
There seems to be a hanging debug check in the default_data_collator method that is not present in the v4.41-release branch code, where it has been removed.
This debug check uses the torch module, but it is not imported at that point during runtime.
Nevertheless its present in at least v4.41.2
Couldn't find the source code for v4.41.2 specifically so creating this issue instead
Who can help?
@Rocketknight1
@sgugger
@sdwalker62
@aromans
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
- Setup a finetuning environment, with arbitrary training data
- Create labels with masking
- The batch should then include "labels" as a key, and it should have one or more values
- use the default_data_collator from transformers library
- you should get a NameError: name 'torch' is not defined
Expected behavior
The debug check should be removed as it does not influence the outcome at all, as we can see in the official v4.41-release branch
Source of bug found at line 93 to 106 in transformers/data/data_collator.py under the default_data_collator method