def multi_label_acc(labels, preds):
    '''
        simplified acc for multi-label classification
        acc = 1 if pred in label(s) set
    '''
    def flatten_label(label):
        if len(label) == 1 and isinstance(label[0],list):
            label = label[0]
        return label
    labels = [flatten_label(l) for l in labels]
    res = [int(preds[i] in labels[i]) for i in range(len(preds))]
    return sum(res)/len(res)

        simplified acc for multi-label classification
        acc = 1 if pred in label(s) set
    
adaptllm/src/utils/metric.py