Hey @ophiry,
The code example at the end of this section in the Encoder-Decoder blog posts: https://huggingface.co/blog/encoder-decoder#decoder 39 gives an example of how to run each part differently. In general the blog post should be helpful in answering your question. To try tweak the code examples the blog post is also available as a google colab.