def get_pred_idx(prediction, choices, options):
    """
    Get the index (e.g. 2) from the prediction (e.g. 'C')
    """
    if prediction in options[:len(choices)]:
        return options.index(prediction)
    else:
        return -1
        return random.choice(range(len(choices)))

    Get the index (e.g. 2) from the prediction (e.g. 'C')
    
internvl_chat_llava/llava/eval/eval_science_qa.py