Skip to content

Commit

Permalink
proper paths handling
Browse files Browse the repository at this point in the history
  • Loading branch information
avishniakov authored Jul 3, 2024
1 parent 91e6f82 commit 8ca140b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions template/steps/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def finetune(
if should_print:
logger.info("Loading datasets...")
tokenizer = load_tokenizer(base_model_id, use_fast=use_fast)
tokenized_train_dataset = load_from_disk(dataset_dir / "train")
tokenized_val_dataset = load_from_disk(dataset_dir / "val")
tokenized_train_dataset = load_from_disk(str((dataset_dir / "train").absolute()))
tokenized_val_dataset = load_from_disk(str((dataset_dir / "val").absolute()))

if should_print:
logger.info("Loading base model...")
Expand Down Expand Up @@ -140,7 +140,6 @@ def finetune(
if should_print:
logger.info("Saving model...")

ft_model_dir = Path(ft_model_dir)
if not use_accelerate or accelerator.is_main_process:
ft_model_dir.mkdir(parents=True, exist_ok=True)
if not use_accelerate:
Expand Down

0 comments on commit 8ca140b

Please sign in to comment.