mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 16:17:57 +01:00
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
@ -6,6 +6,7 @@ import requests
|
|||||||
import yaml
|
import yaml
|
||||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
from modules.utils import get_available_models
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
@ -184,6 +185,8 @@ class Handler(BaseHTTPRequestHandler):
|
|||||||
"permission": []
|
"permission": []
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
models.extend([{ "id": id, "object": "model", "owned_by": "user", "permission": [] } for id in get_available_models() ])
|
||||||
|
|
||||||
response = ''
|
response = ''
|
||||||
if self.path == '/v1/models':
|
if self.path == '/v1/models':
|
||||||
response = json.dumps({
|
response = json.dumps({
|
||||||
|
Loading…
Reference in New Issue
Block a user