Skip to content

Commit

Permalink
fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
xd2333 committed Jun 23, 2023
1 parent 1cc34c4 commit 1d06f3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GalTransl/Backend/GPT4Translate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json, time, asyncio, zhconv, os
import traceback
from GalTransl import LOGGER
from sys import exit
from GalTransl.ConfigHelper import (
Expand Down Expand Up @@ -131,7 +132,7 @@ def __init__(self, config: CProjectConfig, type):
from revChatGPT.V1 import Chatbot as ChatbotV1

gpt_config = {
"model": "gpt-4",
"model": "gpt-4-mobile",
"paid": True,
"access_token": randSelectInList(
config.getBackendConfigSection("ChatGPT")["access_tokens"]
Expand Down Expand Up @@ -205,6 +206,7 @@ async def translate(self, trans_list: CTransList, dict="", proofread=False):
if not self.streamOutputMode:
LOGGER.info(resp)
except Exception as ex:
LOGGER.error(ex)
if "try again later" in str(ex) or "too many requests" in str(ex):
LOGGER.info("-> 请求次数超限,5分钟后继续尝试")
time.sleep(300)
Expand Down

0 comments on commit 1d06f3b

Please sign in to comment.