don't use tokenizer parallelism when using packing (#2862) [skip ci]

This commit is contained in:
Wing Lian
2025-07-06 21:55:09 -04:00
committed by GitHub
parent bf38e507fb
commit b37ddf9778

View File

@@ -609,6 +609,9 @@ def prepare_opinionated_env(cfg):
if cfg.qlora_sharded_model_loading:
# model loading is forked after the tokenizer
os.environ["TOKENIZERS_PARALLELISM"] = "false"
if cfg.sample_packing:
# multipack parallel packing sampler defaults to using fork
os.environ["TOKENIZERS_PARALLELISM"] = "false"
def setup_trainer(