def filter_transforms(transforms: list, data_info: dict):
    """Filter pipeline to avoid KeyError with partial data info."""
    data_info = deepcopy(data_info)
    filtered_transforms = []
    for t in transforms:
        try:
            data_info = t(data_info)
            filtered_transforms.append(t)
        except KeyError:
            pass
    return filtered_transforms
Filter pipeline to avoid KeyError with partial data info.
mmpretrain/apis/multimodal_retrieval.py