Kevin Cui (Black-Hole)
05/08/2025, 6:36 AMKevin Cui (Black-Hole)
05/08/2025, 6:38 AMChaoyu
05/08/2025, 7:42 PMFrost Ming
05/09/2025, 1:32 AMfrom typing import Annotated
import bentoml
from bentoml.validators import ContentType
from PIL import Image
from pydantic import Field
@bentoml.service(image=bentoml.images.Image().python_packages("pillow"))
class MyService:
@bentoml.api
def generate(
self,
image: Annotated[Image.Image, ContentType("image/png")] = Field(
description="PNG image"
),
) -> str:
return f"Received image with size: {image.size} and mode: {image.mode}"
The input signature is exactly the same as yoursFrost Ming
05/09/2025, 1:33 AMKevin Cui (Black-Hole)
05/09/2025, 1:59 AMKevin Cui (Black-Hole)
05/09/2025, 1:59 AMDeploy and wait until the replicas becomes zero, then send a request. Do I understand your scenario correctly?Yes
Kevin Cui (Black-Hole)
05/09/2025, 2:00 AM