Skip to content

Update finetune.py #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions finetune/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def create_datasets(tokenizer, args):
args.dataset_name,
data_dir=args.subset,
split=args.split,
use_auth_token=True,
token=True,
num_proc=args.num_workers if not args.streaming else None,
streaming=args.streaming,
)
Expand Down Expand Up @@ -239,7 +239,7 @@ def run_training(args, train_data, val_data):
# disable caching mechanism when using gradient checkpointing
model = AutoModelForCausalLM.from_pretrained(
args.model_path,
use_auth_token=True,
token=True,
use_cache=not args.no_gradient_checkpointing,
load_in_8bit=True,
device_map={"": Accelerator().process_index},
Expand Down Expand Up @@ -298,7 +298,7 @@ def run_training(args, train_data, val_data):


def main(args):
tokenizer = AutoTokenizer.from_pretrained(args.model_path, use_auth_token=True)
tokenizer = AutoTokenizer.from_pretrained(args.model_path, token=True)
train_dataset, eval_dataset = create_datasets(tokenizer, args)
run_training(args, train_dataset, eval_dataset)

Expand Down