# from accelerate import Accelerator
# accelerator = Accelerator()
# # self.is_deepspeed_enabled = getattr(accelerator.state, "deepspeed_plugin", None) is not None
# is_fsdp_enabled = getattr(accelerator.state, "fsdp_plugin", None) is not None
# if not is_fsdp_enabled: # not sure if this is needed but its for sure safer
# # maybe figuring out how to run everything with accelerate would fix things...
# # ref: https://stackoverflow.com/questions/77204403/does-one-need-to-load-the-model-to-gpu-before-calling-train-when-using-accelerat
# device = torch.device(f"cuda:{0}" if torch.cuda.is_available() else "cpu")
# model = model.to(device)
is not needed. Just load the model and trainer will take care of it.