It looks right, one thing to remember though is, once you train this model you’ll need load weights using torch.load_state_dict, but if you want to leverage from_pretrained then you could modify the BartForConditionalGeneration class to add custom layers.