extensions/openai: include all available models in Model.list (#2368)
Co-authored-by: Matthew Ashton <mashton-gitlab@zhero.org>
This commit is contained in:
parent
e5b756ecfe
commit
a6d3f010a5
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@ import requests
|
|||
import yaml
|
||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
from threading import Thread
|
||||
from modules.utils import get_available_models
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
@ -184,6 +185,8 @@ class Handler(BaseHTTPRequestHandler):
|
|||
"permission": []
|
||||
}]
|
||||
|
||||
models.extend([{ "id": id, "object": "model", "owned_by": "user", "permission": [] } for id in get_available_models() ])
|
||||
|
||||
response = ''
|
||||
if self.path == '/v1/models':
|
||||
response = json.dumps({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue