How to output loss from model.generate()?

Thanks for sharing your simple solution! :heart_eyes:

I’ll give this method a try!