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

how to setup epoch number in SFTTrainer? #985

Closed
KlausikPL opened this issue Nov 12, 2023 · 2 comments
Closed

how to setup epoch number in SFTTrainer? #985

KlausikPL opened this issue Nov 12, 2023 · 2 comments

Comments

@KlausikPL
Copy link

KlausikPL commented Nov 12, 2023

there my example code
from datasets import load_dataset
from trl import SFTTrainer

dataset = load_dataset("IMDB", split="train")

trainer = SFTTrainer(
"sshleifer/tiny-gpt2",
train_dataset=dataset,
dataset_text_field="text",
max_seq_length=512,
)
trainer.train()

@younesbelkada
Copy link
Contributor

You need to instantiate a new object of TrainingArguments and pass num_train_epochs to it. Check out for example what is done here: https://github.com/huggingface/trl/blob/main/examples/scripts/sft.py#L113

@KlausikPL
Copy link
Author

thanks you for help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants