mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-05 19:15:34 +00:00
remove gpt-4-0314 from model list (#371)
* remove gpt-4-0314 from model list * fix: better model_list Signed-off-by: yihong0618 <zouzou0208@gmail.com> --------- Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
parent
40aaa9b090
commit
79796456c3
@ -25,8 +25,9 @@ GPT35_MODEL_LIST = [
|
||||
GPT4_MODEL_LIST = [
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-0613",
|
||||
"gpt-4-0314",
|
||||
"gpt-4-32k-0613",
|
||||
]
|
||||
|
||||
|
||||
@ -65,7 +66,12 @@ class ChatGPTAPI(Base):
|
||||
self.deployment_id = None
|
||||
self.temperature = temperature
|
||||
# gpt3 all models for save the limit
|
||||
self.model_list = cycle(GPT35_MODEL_LIST)
|
||||
my_model_list = [
|
||||
i["id"] for i in self.openai_client.models.list().model_dump()["data"]
|
||||
]
|
||||
model_list = list(set(my_model_list) & set(GPT35_MODEL_LIST))
|
||||
print(f"Using model list {model_list}")
|
||||
self.model_list = cycle(model_list)
|
||||
|
||||
def rotate_key(self):
|
||||
self.openai_client.api_key = next(self.keys)
|
||||
@ -305,4 +311,9 @@ class ChatGPTAPI(Base):
|
||||
)
|
||||
|
||||
def set_gpt4_models(self, model="gpt4"):
|
||||
self.model_list = cycle(GPT4_MODEL_LIST)
|
||||
my_model_list = [
|
||||
i["id"] for i in self.openai_client.models.list().model_dump()["data"]
|
||||
]
|
||||
model_list = list(set(my_model_list) & set(GPT4_MODEL_LIST))
|
||||
print(f"Using model list {model_list}")
|
||||
self.model_list = cycle(model_list)
|
||||
|
Loading…
x
Reference in New Issue
Block a user