winglian commited on
Commit
86a91e2
1 Parent(s): 094fc2c

save tokenizer before training starts (#380)

Browse files
Files changed (1) hide show
  1. scripts/finetune.py +1 -0
scripts/finetune.py CHANGED
@@ -307,6 +307,7 @@ def train(
307
 
308
  if not Path(cfg.output_dir).is_dir():
309
  os.makedirs(cfg.output_dir, exist_ok=True)
 
310
  if cfg.flash_optimum:
311
  with torch.backends.cuda.sdp_kernel(
312
  enable_flash=True, enable_math=True, enable_mem_efficient=True
 
307
 
308
  if not Path(cfg.output_dir).is_dir():
309
  os.makedirs(cfg.output_dir, exist_ok=True)
310
+ tokenizer.save_pretrained(cfg.output_dir)
311
  if cfg.flash_optimum:
312
  with torch.backends.cuda.sdp_kernel(
313
  enable_flash=True, enable_math=True, enable_mem_efficient=True