def _tci(func):  # "typecheck inputs"
    """
    Decorate a method to validate its inputs against its signature. Also make
    sure string inputs are non-empty.
    """

    sig = signature(func)

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        bindings = sig.bind(*args, **kwargs)

        for param, annot in sig.parameters.items():
            if param == "self":
                continue
            if annot is not None:
                pident = f"Input `{param}` to `{func.__name__}`"
                v = bindings.arguments[param]

                typ_origin = get_origin(annot.annotation)
                if typ_origin == Union:
                    annotation = get_args(annot.annotation)
                    annotation_name = (
                        "(" + ", ".join(a.__name__ for a in annotation) + ")"
                    )
                elif typ_origin:
                    annotation = typ_origin
                    annotation_name = annotation.__name__
                else:
                    annotation = annot.annotation
                    annotation_name = annot.annotation.__name__

                if not isinstance(v, annotation):
                    raise TypeError(
                        f"{pident} must be of type `{annotation_name}` but was `{type(v).__name__}` instead."
                    )
                if annot.annotation is str:
                    if len(v) == 0:
                        raise ValueError(f"{pident} must be non-empty.")

        return func(*bindings.args, **bindings.kwargs)

    wrapper.__signature__ = sig

    return wrapper

    Decorate a method to validate its inputs against its signature. Also make
    sure string inputs are non-empty.
    
src/providers/huggingface/trulens/providers/huggingface/provider.py