considering add some logic here, responsing with some text like "I don't know" when the model output is with some probs lower than threshold ,which means that it is not that confident.
https://github.com/huggingface/transformers/blob/f67dac97bdc63874f2288546b3fa87e69d2ea1c8/src/transformers/generation/utils.py#LL2650C69-L2650C69

considering add some logic here, responsing with some text like "I don't know" when the model output is with some probs lower than threshold ,which means that it is not that confident.
stopping_criteria may works