Using generate() method with decoder

How does one use the model.generate() method in BART, with just the decoder?
Is it possible to take the encoder outputs, and feed it into the BART decoder, and use the generate method on just the decoder? If possible, could you provide a code snippet for the same?