Skip to content

Commit b4f72da

Browse files
committed
better caching, init option, serve v0.6 update
1 parent ce4b735 commit b4f72da

File tree

2 files changed

+293
-270
lines changed

2 files changed

+293
-270
lines changed

torchserve_dashboard/api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def stop_torchserve(self) -> Union[str, Exception]:
9595
except (subprocess.CalledProcessError, OSError) as e:
9696
return e
9797

98+
def get_model_store(self) -> List[str]:
99+
return os.listdir(self.model_store)
100+
98101

99102
class ManagementAPI:
100103
def __init__(self, address: str, error_callback: Callable = None) -> None:
@@ -118,12 +121,15 @@ def get_loaded_models(self) -> Optional[Dict[str, Any]]:
118121
def get_model(self,
119122
model_name: str,
120123
version: Optional[str] = None,
121-
list_all: bool = False) -> List[Dict[str, Any]]:
124+
list_all: bool = False,
125+
custom_metadata: bool = False) -> List[Dict[str, Any]]:
122126
req_url = self.address + "/models/" + model_name
123127
if version:
124128
req_url += "/" + version
125129
elif list_all:
126130
req_url += "/all"
131+
if custom_metadata:
132+
req_url += "?customized=true"
127133

128134
res = self.client.get(req_url)
129135
return res.json()

0 commit comments

Comments
 (0)