def _validate_pipeline_type(
    _: t.Any, attribute: attr.Attribute[str | list[str]], value: str | list[str]
) -> None:
    """
    Validate the type of the given pipeline definition. The value is expected to be a `str`.
    `list` type is also allowed here to maintain compatibility with an earlier introduced bug.

    TODO: disallow list type in the next minor version release.
    """
    if not isinstance(value, str) and not isinstance(value, list):
        raise ValueError(f"{attribute.name} must be a string")
Validate the type of the given pipeline definition. The value is expected to be a `str`.
`list` type is also allowed here to maintain compatibility with an earlier introduced bug.

TODO: disallow list type in the next minor version release.
src/bentoml/_internal/frameworks/transformers.py