Finetuning GPT2 using Multiple GPU and Trainer

@aclifton314 Hi, sorry I am trying to train and evaluate my GPT-2 by applying the trainer with GPU ,I am not sure how I can pass my model and the training data and evaluation data to the GPU in this form. I would appreciate your idea.
my code is:

model = AutoModel.from_pretrained(“”).to(“cuda”)

training_args = TrainingArguments(
output_dir=“./gpt2-gerchef”, #The output directory
overwrite_output_dir=True, #overwrite the content of the output directory
num_train_epochs=3, # number of training epochs
per_device_train_batch_size=32, # batch size for training
per_device_eval_batch_size=64, # batch size for evaluation
eval_steps = 400, # Number of update steps between two evaluations.
save_steps=800, # after # steps model is saved
warmup_steps=500,# number of warmup steps for learning rate scheduler
prediction_loss_only=True,
)

trainer = Trainer(
model=model,
args=training_args,
data_collator=data_collator,
train_dataset=train_dataset,
eval_dataset=test_dataset,
)