How to set stopping criteria in model.generate() when a certain word appears

@Pradeep1995 this may be a good solution.

1 Like