This message was deleted.
# ask-for-help
s
This message was deleted.
a
Hey @Lennard Berger, welcome to the community. congaparrot I'm still learning use of bentoml, I think internally bentoml has validation around the inputs and output, it must not support primitive types of the box. Try something like this as a workaround till I can dig more and find out what the problem is
Copy code
class Model(BaseModel):
    __root__: list[str]

@svc.api(input=JSON(pydantic_model=Model), output=NumpyNdarray())
def predict_bentoml(input_data: Model) -> np.ndarray:
    pass
l
Will look into this, thanks!
a
Hope it helps 🙏
From Inference API definition looks like the input and output defined needs to be type of
IODescriptor
, which is why I think using primitive type might not work.
Copy code
class InferenceAPI:
    def __init__(
        self,
        user_defined_callback: t.Callable[..., t.Any] | None,
        input_descriptor: IODescriptor[t.Any],
        output_descriptor: IODescriptor[t.Any],
        name: Optional[str],
        doc: Optional[str] = None,
        route: Optional[str] = None,
    ):