mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-01-20 15:40:23 +01:00
Fix the /v1/models output format (closes #7089)
This commit is contained in:
parent
9c6913ad61
commit
dcdc42fa06
|
|
@ -15,7 +15,7 @@ def get_current_model_info():
|
|||
|
||||
|
||||
def list_models():
|
||||
return {'model_names': get_available_models()[1:]}
|
||||
return {'model_names': get_available_models()}
|
||||
|
||||
|
||||
def model_info_dict(model_name: str) -> dict:
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ async def handle_models(request: Request):
|
|||
is_list = request.url.path.split('?')[0].split('#')[0] == '/v1/models'
|
||||
|
||||
if is_list:
|
||||
response = OAImodels.list_models()
|
||||
response = OAImodels.list_models()['model_names']
|
||||
else:
|
||||
model_name = path[len('/v1/models/'):]
|
||||
response = OAImodels.model_info_dict(model_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue