From 95c7eb02f47f3161933c6b3acaf265bdbc0ed5df Mon Sep 17 00:00:00 2001 From: sauyon <2347889+sauyon@users.noreply.github.com> Date: Thu, 27 Oct 2022 20:24:33 -0700 Subject: [PATCH] format? --- src/bentoml/client.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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