def _validate_model_args(
    args: Union[_ServableType, List[_ServableType], Tuple[_ServableType, ...], Dict[str, _ServableType]]
) -> None:
    """Validator for machine learning models.

    Parameters
    ----------
    args
        model args passed into ``__init__`` of ``ModelComponent``

    Raises
    ------
    ValueError
        If an empty iterable is passed as the model argument
    TypeError
        If the args do not contain properly formatted model refences

    """
    if isiterable(args) and len(args) == 0:
        raise ValueError(f"Iterable args={args} must have length >= 1")

    if isinstance(args, (list, tuple)):
        if not all(isinstance(x, _Servable_t) for x in args):
            raise TypeError(f"One of arg in args={args} is not type {_Servable_t}")
    elif isinstance(args, dict):
        if not all(isinstance(x, str) for x in args):
            raise TypeError(f"One of keys in args={args.keys()} is not type {str}")
        if not all(isinstance(x, _Servable_t) for x in args.values()):
            raise TypeError(f"One of values in args={args} is not type {_Servable_t}")
    elif not isinstance(args, _Servable_t):
        raise TypeError(f"Args must be instance, list/tuple, or mapping of {_Servable_t}")
Validator for machine learning models.

    Parameters
    ----------
    args
        model args passed into ``__init__`` of ``ModelComponent``

    Raises
    ------
    ValueError
        If an empty iterable is passed as the model argument
    TypeError
        If the args do not contain properly formatted model refences

    
src/flash/core/serve/component.py