model.to(device)

train_dataloader, eval_dataloader, model, optimizer = accelerator.prepare(

train_dataloader, eval_dataloader, model, optimizer
)

num_epochs = 3
  num_training_steps = num_epochs * len(train_dataloader)
  lr_scheduler = get_scheduler(
      "linear",
      optimizer=optimizer,
      num_warmup_steps=0,
      num_training_steps=num_training_steps
  )
progress_bar = tqdm(range(num_training_steps))
model.train()
  for epoch in range(num_epochs):
      for batch in train_dataloader: