This message was deleted.
# ask-for-help
s
This message was deleted.
s
It's not a type hint, it's the class that BentoML uses to construct the input from the HTTP request.
The type hint should still be
np.ndarray
.
s
Oh I see - I misread that. Thanks for clearing it up!
I’m just curious though - why is this required? Seem a bit restrictive to specify inputs and outputs this way. Why not allow ANY input and output?
s
I'm not super sure what you mean by that; we need to know what we're the request body to and how the conversion should be done, which is what the IO descriptor provides.
The IO descriptors are customizable, if you'd like to implement your own.
s
OK I must not be understanding what BentoML does under the hood - I meant for example using something like Fast API, it can handle any request body and response since it’s a generic server.
s
You could do that yourself with a custom IO descriptor (or just a bytes input), but BentoML is for ML applications, and most users prefer to have their input just be an ndarray that they can immediately use instead of doing the conversion themselves.
s
OK so it’s mostly for convenience that you provide these classes
s
A lot of the goal when designing BentoML was to make the framework as easy to use for data scientists as possible, so the idea is that they don't have to understand that there's an underlying request at all. As a bonus, it also allows us to support both HTTP and gRPC servers with a single API endpoint definition.
Yeah, for convenience, since BentoML isn't meant to be a general-purpose HTTP server framework.
👍 1
s
Right - I think I get it now. Thanks for explaining this!
s
👍 no problem!
👍 1