From 408b1f36640fc5830f0b7e3a3283275da1f08f5d Mon Sep 17 00:00:00 2001 From: Jialei Date: Tue, 3 Jan 2023 11:03:25 +0800 Subject: [PATCH] chore(client): optimize model build when no model serving api --- client/starwhale/api/_impl/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/starwhale/api/_impl/service.py b/client/starwhale/api/_impl/service.py index 6a0f5b01e9..a2df5e63dc 100644 --- a/client/starwhale/api/_impl/service.py +++ b/client/starwhale/api/_impl/service.py @@ -47,6 +47,9 @@ def add_api_instance(self, api_: Api) -> None: self.apis[api_.uri] = api_ def get_spec(self) -> t.Any: + # fast path + if not self.apis: + return {} server = self._gen_gradio_server() return server.get_config_file()