radinhas commited on
Commit
1375c75
1 Parent(s): ece1e2d

Update apis/chat_api.py

Browse files
Files changed (1) hide show
  1. apis/chat_api.py +4 -14
apis/chat_api.py CHANGED
@@ -1,6 +1,7 @@
1
  import argparse
2
  import uvicorn
3
  import sys
 
4
 
5
  from fastapi import FastAPI
6
  from pydantic import BaseModel, Field
@@ -21,20 +22,9 @@ class ChatAPIApp:
21
  self.setup_routes()
22
 
23
  def get_available_models(self):
24
- self.available_models = [
25
- {
26
- "id": "mixtral-8x7b",
27
- "description": "[Mixtral-8x7B-Instruct-v0.1]: https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1",
28
- },
29
- {
30
- "id": "mistral-7b",
31
- "description": "[Mistral-7B-Instruct-v0.2]: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2",
32
- },
33
- {
34
- "id": "openchat-3.5",
35
- "description": "[openchat_3.5]: https://huggingface.co/openchat/openchat_3.5",
36
- },
37
- ]
38
  return self.available_models
39
 
40
  class ChatCompletionsPostItem(BaseModel):
 
1
  import argparse
2
  import uvicorn
3
  import sys
4
+ import json
5
 
6
  from fastapi import FastAPI
7
  from pydantic import BaseModel, Field
 
22
  self.setup_routes()
23
 
24
  def get_available_models(self):
25
+ f = open('lang_name.json')
26
+ data = json.load(f)
27
+ self.available_models = data
 
 
 
 
 
 
 
 
 
 
 
28
  return self.available_models
29
 
30
  class ChatCompletionsPostItem(BaseModel):