def cast_to_set(object) -> set:
    """Try to cast an object as a set."""
    object = freeze_structure(object)
    if isinstance(object, (frozenset, set, tuple)):
        return set(object)
    return str_to_set(object)
Try to cast an object as a set.
vlmeval/dataset/utils/megabench/scoring/common/conversions.py