Skip to content
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

fix bug in run_clm_sft_with_peft.py #674

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/training/run_clm_sft_with_peft.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,14 @@ def main():
"You can do it from another script, save it, and load it from here, using --tokenizer_name."
)

if (len(tokenizer))!=49954:
raise ValueError(f"The vocab size of the tokenizer must be 49954, but found {len(tokenizer)}.\n"
"Please use Chinese Alpaca tokenizer!")
if tokenizer.pad_token is None:
print(f"Adding pad token {DEFAULT_PAD_TOKEN}")
tokenizer.add_special_tokens(dict(pad_token=DEFAULT_PAD_TOKEN))

if (len(tokenizer))!=49954:
raise ValueError(f"The vocab size of the tokenizer must be 49954, but found {len(tokenizer)}.\n"
"Please use Chinese Alpaca tokenizer!")

data_collator = DataCollatorForSupervisedDataset(tokenizer=tokenizer)
eval_dataset=None
train_dataset = None
Expand Down