From db7ecdd274fe886813acb663882993c4f6055af2 Mon Sep 17 00:00:00 2001 From: hronoas Date: Mon, 16 Oct 2023 23:02:47 +0300 Subject: [PATCH] openai: fix empty models list on query present in url (#4139) --- extensions/openai/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/openai/script.py b/extensions/openai/script.py index 097689bb..72fd1610 100644 --- a/extensions/openai/script.py +++ b/extensions/openai/script.py @@ -128,7 +128,7 @@ class Handler(BaseHTTPRequestHandler): if self.path.startswith('/v1/engines') or self.path.startswith('/v1/models'): is_legacy = 'engines' in self.path - is_list = self.path in ['/v1/engines', '/v1/models'] + is_list = self.path.split('?')[0].split('#')[0] in ['/v1/engines', '/v1/models'] if is_legacy and not is_list: model_name = self.path[self.path.find('/v1/engines/') + len('/v1/engines/'):] resp = OAImodels.load_model(model_name)