Skip to content

Commit c66bdd6

Browse files
Addressing review comments
1 parent 88fa1cc commit c66bdd6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ads/aqua/extension/model_handler.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,13 @@ def post(self, *args, **kwargs): # noqa: ARG002
319319

320320
class AquaModelTokenizerConfigHandler(AquaAPIhandler):
321321
def get(self, model_id):
322-
url_parse = urlparse(self.request.path)
323-
paths = url_parse.path.strip("/")
324-
path_list = paths.split("/")
322+
"""
323+
Handles requests for retrieving the Hugging Face tokenizer configuration of a specified model.
324+
Expected request format: GET /aqua/models/<model-ocid>/tokenizer
325+
326+
"""
327+
328+
path_list = urlparse(self.request.path).path.strip("/").split("/")
325329
# Path should be /aqua/models/ocid1.iad.ahdxxx/tokenizer
326330
# path_list=['aqua','models','<model-ocid>','tokenizer']
327331
if (
@@ -330,8 +334,8 @@ def get(self, model_id):
330334
and path_list[3] == "tokenizer"
331335
):
332336
return self.finish(AquaModelApp().get_hf_tokenizer_config(model_id))
333-
else:
334-
raise HTTPError(400, f"The request {self.request.path} is invalid.")
337+
338+
raise HTTPError(400, f"The request {self.request.path} is invalid.")
335339

336340

337341
__handlers__ = [

0 commit comments

Comments
 (0)