# compute logits and probabilities outputs = model(**inputs) logits_per_text = outputs.logits_per_text probs = logits_per_text.softmax(dim=1) # print best match best_match = image_list[probs.argmax()] prob_match = round(float(probs[0][probs.argmax()]),4) print("Match probability: ",prob_match) display(best_match)