Skip to content

Commit

Permalink
Merge pull request #178 from MrChengmo/fix_get_model_name
Browse files Browse the repository at this point in the history
Fix Get Model API
  • Loading branch information
MrChengmo authored Mar 12, 2024
2 parents 69349f3 + 4d7f31d commit a519317
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions appbuilder/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ def __init__(self, client: HTTPClient):

def get_model_url(self, model_name: str) -> str:
"""获取模型在工作台网关的请求url"""
origin_name = model_name
short_name = model_name
remote_model_name_collector = RemoteModelCollector()
origin_name = remote_model_name_collector.get_remote_name_by_short_name(origin_name)
origin_name = remote_model_name_collector.get_remote_name_by_short_name(short_name)
if not origin_name:
origin_name = short_name
for model in self.model_list:
if model.name == origin_name:
return convert_cloudhub_url(self.client, model.url)
Expand All @@ -97,9 +99,11 @@ def get_model_url(self, model_name: str) -> str:

def get_model_type(self, model_name: str) -> str:
"""获取模型类型"""
origin_name = model_name
short_name = model_name
remote_model_name_collector = RemoteModelCollector()
origin_name = remote_model_name_collector.get_remote_name_by_short_name(origin_name)
origin_name = remote_model_name_collector.get_remote_name_by_short_name(short_name)
if not origin_name:
origin_name = short_name
for model in self.model_list:
if model.name == origin_name:
return model.apiType
Expand Down

0 comments on commit a519317

Please sign in to comment.