Make training args fully immutable (#25435)
* Make training args fully immutable * Working tests, PyTorch * In test_trainer * during testing * Use proper dataclass way * Fix test * Another one * Fix tf * Lingering slow * Exception * Clean
This commit is contained in:
@@ -21,6 +21,7 @@ https://huggingface.co/models?filter=fill-mask
|
||||
"""
|
||||
# You can also adapt this script on your own masked language modeling task. Pointers for this are left as comments.
|
||||
|
||||
import dataclasses
|
||||
import json
|
||||
import logging
|
||||
import math
|
||||
@@ -366,7 +367,7 @@ def main():
|
||||
# If we have ref files, need to avoid it removed by trainer
|
||||
has_ref = data_args.train_ref_file or data_args.validation_ref_file
|
||||
if has_ref:
|
||||
training_args.remove_unused_columns = False
|
||||
training_args = dataclasses.replace(training_args, remove_unused_columns=False)
|
||||
|
||||
# Data collator
|
||||
# This one will take care of randomly masking the tokens.
|
||||
|
||||
Reference in New Issue
Block a user