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

Running Trainer on CPU #138

Open
rdabc opened this issue Sep 18, 2024 · 1 comment
Open

Running Trainer on CPU #138

rdabc opened this issue Sep 18, 2024 · 1 comment

Comments

@rdabc
Copy link

rdabc commented Sep 18, 2024

Hi,

It seems that the trainer is running by default on GPU (from transformers import Trainer), how can I run it on CPU ? I did not find an argument "device" in Trainer.
trainer = Trainer(
model=model,
args=train_args,
train_dataset=train_dataset,
eval_dataset=valid_dataset,
callbacks=[early_stopping_callback],
)
trainer.train()

Thank you

@wgifford
Copy link
Collaborator

In train_args set use_cpu=True

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