winglian commited on
Commit
2393801
1 Parent(s): d060c80

prepare datasets only flag

Browse files
Files changed (1) hide show
  1. scripts/finetune.py +5 -0
scripts/finetune.py CHANGED
@@ -306,6 +306,7 @@ def setup_trainer(cfg, train_dataset, eval_dataset, model, tokenizer):
306
 
307
  def train(
308
  config: Path = Path("configs/"),
 
309
  **kwargs,
310
  ):
311
  if Path(config).is_dir():
@@ -396,6 +397,10 @@ def train(
396
  else:
397
  dataset.save_to_disk(DEFAULT_DATASET_PREPARED_PATH)
398
 
 
 
 
 
399
  train_dataset = dataset["train"]
400
  eval_dataset = dataset["test"]
401
 
 
306
 
307
  def train(
308
  config: Path = Path("configs/"),
309
+ prepare_ds_only: bool = False,
310
  **kwargs,
311
  ):
312
  if Path(config).is_dir():
 
397
  else:
398
  dataset.save_to_disk(DEFAULT_DATASET_PREPARED_PATH)
399
 
400
+ if prepare_ds_only:
401
+ logger.info("Finished preparing dataset. Exiting...")
402
+ return
403
+
404
  train_dataset = dataset["train"]
405
  eval_dataset = dataset["test"]
406