BentoML
BentoML copied to clipboard
feat: restrict mime types on Image IO descriptor
Allow only a subset of image mime types and reject the rest.
@api(input=Image(mime_type=['image/jpeg', 'image/png'], validate=True), output=JSON())
def predict(input_image: PIL.Image.Image) -> dict:
...
Potentially extend the validation to all IO descriptors for mime_types.