You could try to lower the batch size, use a smaller model, or use torch.utils.checkpoint to trade compute for memory.
If that doesn’t work, you could use e.g. Colab, which should provide a GPU with more memory.