Skip to content

Commit

Permalink
check for huggingface batch sizes (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeid93 committed Sep 28, 2022
1 parent db3d209 commit 4d4b03a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions runtimes/huggingface/mlserver_huggingface/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from mlserver_huggingface.codecs import MultiStringRequestCodec
from transformers.pipelines import SUPPORTED_TASKS
from optimum.pipelines import SUPPORTED_TASKS as SUPPORTED_OPTIMUM_TASKS
from mlserver.logging import logger


class HuggingFaceRuntime(MLModel):
Expand Down Expand Up @@ -57,6 +58,12 @@ def __init__(self, settings: ModelSettings):
),
)

if settings.max_batch_size != self.hf_settings.batch_size:
logger.warning(
f"hf batch_size: {self.hf_settings.batch_size} is different "
f"from MLServer max_batch_size: {settings.max_batch_size}"
)

super().__init__(settings)

async def load(self) -> bool:
Expand Down

0 comments on commit 4d4b03a

Please sign in to comment.