Trocr Inference confidence problem

Hello everyone.

How can confidence in model output be handled? After fine-tuning the model, I tested it with a blank image, and the model generated some characters. I attempted to use the following code to evaluate confidence:

ids, scores = generated_outputs['sequences'], generated_outputs['sequences_scores']
confidence = torch.exp(scores)

The result was:

Predicted Text: ,9)_.7% Confidence: tensor([0.9678], device=‘mps:0’)

Even when using the pre-trained model directly, it always produces some output instead of an empty result.