How to generate nn.Transformer output using only src (no tgt) sequence?)

I have trained an nn.Transformer model using required src and tgt sequences


out = transformer(src, tgt)

and now I want to use the model to generate sequences using a src sequence only but it’s not obvious how to do this.

Desired Eval:

out = transformer(src)

Any ideas?

1 Like