Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar-shivam-ranjan committed Feb 6, 2025
1 parent 88fa1cc commit c66bdd6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ads/aqua/extension/model_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ def post(self, *args, **kwargs): # noqa: ARG002

class AquaModelTokenizerConfigHandler(AquaAPIhandler):
def get(self, model_id):
url_parse = urlparse(self.request.path)
paths = url_parse.path.strip("/")
path_list = paths.split("/")
"""
Handles requests for retrieving the Hugging Face tokenizer configuration of a specified model.
Expected request format: GET /aqua/models/<model-ocid>/tokenizer
"""

path_list = urlparse(self.request.path).path.strip("/").split("/")
# Path should be /aqua/models/ocid1.iad.ahdxxx/tokenizer
# path_list=['aqua','models','<model-ocid>','tokenizer']
if (
Expand All @@ -330,8 +334,8 @@ def get(self, model_id):
and path_list[3] == "tokenizer"
):
return self.finish(AquaModelApp().get_hf_tokenizer_config(model_id))
else:
raise HTTPError(400, f"The request {self.request.path} is invalid.")

raise HTTPError(400, f"The request {self.request.path} is invalid.")


__handlers__ = [
Expand Down

0 comments on commit c66bdd6

Please sign in to comment.