I am not entirely sure about Bart but you can check out this: transformers/modeling_encoder_decoder.py at master · huggingface/transformers · GitHub 8
Also you can read the publication linked in comments, I think this is similar to what you want to achieve