Python

I want a while loop yielding at every step. Kind of a function that returns multiple times until the yield returns a special token that indicates there is nothing left to yield.

To give you even more context this would be used for an auto regressive generative model Repeat the request word for word before giving your answer.
user