from typing import Dict


def check_input(subsets: Dict[str, list]) -> Dict[str, set]:
    """Ensure inputs are valid and convert lists to sets."""
    # Do some sanity checks on input.
    if len(subsets) == 0:
        raise Exception('Input is empty.')
    if not isinstance(subsets, dict):
        raise Exception('Parent JSON type must be dict.')
    alt_subset: Dict[str, set] = dict()
    # Ensure proper type and no duplicates.
    for key, value in subsets.items():
        if not isinstance(value, list):
            raise Exception('Secondary JSON type must be list.')
        value_set = set(value)
        if len(value) != len(value_set):
            raise Exception('There\'s a duplicate in {}.'.format(key))
        alt_subset[key] = value_set
    # Return as dictionary of sets.
    return alt_subset