mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-17 19:04:39 +01:00
API: Fix /v1/models to only list the currently loaded model
This commit is contained in:
parent
1a2b840938
commit
f6a749a151
|
|
@ -20,10 +20,14 @@ def list_models():
|
|||
|
||||
def list_models_openai_format():
|
||||
"""Returns model list in OpenAI API format"""
|
||||
model_names = get_available_models()
|
||||
if shared.model_name and shared.model_name != 'None':
|
||||
data = [model_info_dict(shared.model_name)]
|
||||
else:
|
||||
data = []
|
||||
|
||||
return {
|
||||
"object": "list",
|
||||
"data": [model_info_dict(name) for name in model_names]
|
||||
"data": data
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue