diff --git a/src/bentoml/client.py b/src/bentoml/client.py index 8441edfc6a8..6452e2e9cfe 100644 --- a/src/bentoml/client.py +++ b/src/bentoml/client.py @@ -31,8 +31,14 @@ def __init__(self, svc: Service, server_url: str): for name, api in self._svc.apis.items(): if not hasattr(self, name): - setattr(self, name, functools.partial(self._sync_call, _bentoml_api=api)) - setattr(self, f"async_{name}", functools.partial(self._call, _bentoml_api=api)) + setattr( + self, name, functools.partial(self._sync_call, _bentoml_api=api) + ) + setattr( + self, + f"async_{name}", + functools.partial(self._call, _bentoml_api=api), + ) def call(self, bentoml_api_name: str, inp: t.Any = None, **kwargs: t.Any) -> t.Any: return asyncio.run(self.async_call(bentoml_api_name, inp)) @@ -42,7 +48,9 @@ async def async_call( ) -> t.Any: return await self._call(inp, _bentoml_api=self._svc.apis[bentoml_api_name]) - def _sync_call(self, inp: t.Any = None, *, _bentoml_api: InferenceAPI, **kwagrs: t.Any): + def _sync_call( + self, inp: t.Any = None, *, _bentoml_api: InferenceAPI, **kwagrs: t.Any + ): return asyncio.run(self._call(inp, _bentoml_api=_bentoml_api)) @abstractmethod