fix openai models response

This commit is contained in:
Cyberes 2023-10-01 23:07:49 -06:00
parent 21da2f6373
commit d1c4e68f8b
1 changed files with 26 additions and 27 deletions

View File

@ -25,12 +25,13 @@ def openai_list_models():
else:
running_model = redis.get('running_model', 'ERROR', dtype=str)
oai = fetch_openai_models()
r = []
if opts.openai_expose_our_model:
r = [{
r = {
"object": "list",
"data": [
{
"data": oai
}
# TODO: verify this works
if opts.openai_expose_our_model:
r["data"].insert(0, {
"id": running_model,
"object": "model",
"created": int(server_start_time.timestamp()),
@ -53,10 +54,8 @@ def openai_list_models():
],
"root": None,
"parent": None
}
]
}]
response = jsonify_pretty(r + oai), 200
})
response = jsonify_pretty(r), 200
return response