Spaces:
Running
Running
jonathanjordan21
commited on
Commit
•
55b4f54
1
Parent(s):
feb8c06
Update apis/chat_api.py
Browse files- apis/chat_api.py +6 -1
apis/chat_api.py
CHANGED
@@ -44,6 +44,11 @@ class ChatAPIApp:
|
|
44 |
def get_available_models(self):
|
45 |
return {"object": "list", "data": AVAILABLE_MODELS_DICTS}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
def extract_api_key(
|
48 |
credentials: HTTPAuthorizationCredentials = Depends(HTTPBearer()),
|
49 |
):
|
@@ -323,7 +328,7 @@ class ChatAPIApp:
|
|
323 |
"/api/tags",
|
324 |
summary="Get Available Models Ollama",
|
325 |
include_in_schema=True,
|
326 |
-
)(self.
|
327 |
|
328 |
self.app.get(
|
329 |
"/readme",
|
|
|
44 |
def get_available_models(self):
|
45 |
return {"object": "list", "data": AVAILABLE_MODELS_DICTS}
|
46 |
|
47 |
+
def get_available_models_ollama(self):
|
48 |
+
ollama_models_dict = AVAILABLE_MODELS_DICTS.copy()
|
49 |
+
ollama_models_dict['name'] = ollama_models_dict.pop('id')
|
50 |
+
return {"object": "list", "models":ollama_models_dict}
|
51 |
+
|
52 |
def extract_api_key(
|
53 |
credentials: HTTPAuthorizationCredentials = Depends(HTTPBearer()),
|
54 |
):
|
|
|
328 |
"/api/tags",
|
329 |
summary="Get Available Models Ollama",
|
330 |
include_in_schema=True,
|
331 |
+
)(self.get_available_models_ollama)
|
332 |
|
333 |
self.app.get(
|
334 |
"/readme",
|