@@ -117,9 +117,9 @@ def __init__(self, path: str, name: str = ""):
117
117
"""
118
118
super ().__init__ (path , name )
119
119
120
- model_path : Path = Path (path )
121
- self ._name = model_path .stem
122
- self ._model_config = parse_triton_config_pbtxt (model_path / "config.pbtxt" )
120
+ self . _model_path : Path = Path (path )
121
+ self ._name = self . _model_path .stem
122
+ self ._model_config = parse_triton_config_pbtxt (self . _model_path / "config.pbtxt" )
123
123
# The model name in the config.pbtxt, if present, must match the model folder name.
124
124
if self ._model_config .name and self ._model_config .name .casefold () != self ._name .casefold ():
125
125
raise ValueError (
@@ -154,7 +154,7 @@ def connect(self, netloc: str, **kwargs):
154
154
@property
155
155
def model_config (self ):
156
156
if not self ._model_config : # not expected to happen with the current implementation.
157
- self ._model_config = parse_triton_config_pbtxt (self .path / "config.pbtxt" )
157
+ self ._model_config = parse_triton_config_pbtxt (self ._model_path / "config.pbtxt" )
158
158
return self ._model_config
159
159
160
160
@property
@@ -171,24 +171,6 @@ def predictor(self):
171
171
172
172
@classmethod
173
173
def accept (cls , path : str ) -> tuple [bool , str ]:
174
- return cls .accept_local (path )
175
-
176
- @classmethod
177
- def accept_remote (cls , path : str ) -> tuple [bool , str ]:
178
- # Check if the path is a valid Triton URL and also if the server is live
179
- # This function is not yet fully implemneted or used, as it is meant to be used for
180
- # dynamically querying the server for the model config instead of the local config.pbtxt file.
181
- if path and not bool (re .search (r"\s" , path )) and not Path (path ).is_dir ():
182
- # Let's assume that the path is a url netloc, but
183
- # for host:port, urlparse will parse it to
184
- # (scheme='localhost', netloc='', path='80', params='', query='', fragment='')
185
- # and for host only, path='localhost'
186
- url = urlparse (path )
187
- if url .scheme or url .path or url .netloc :
188
- return True , cls .model_type
189
-
190
- @classmethod
191
- def accept_local (cls , path : str ) -> tuple [bool , str ]:
192
174
model_folder : Path = Path (path )
193
175
194
176
# The path should be a folder path, for an individual model, and must have the config.pbtxt file.
0 commit comments