Skip to content

Commit

Permalink
moved to v0.4.0 alpha easytl
Browse files Browse the repository at this point in the history
  • Loading branch information
Bikatr7 committed May 20, 2024
1 parent eaade4c commit 71b0f92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/common/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## third-party libraries
## for importing, other scripts will use from common.exceptions instead of from the third-party libraries themselves
from easytl import AuthenticationError, InternalServerError, RateLimitError, APITimeoutError, APIConnectionError, APIStatusError
from easytl import AuthorizationException, QuotaExceededException, DeepLException
from easytl import OpenAIAuthenticationError, OpenAIInternalServerError, OpenAIRateLimitError, OpenAIAPITimeoutError, OpenAIAPIConnectionError, OpenAIAPIStatusError
from easytl import DeepLAuthorizationException, DeepLQuotaExceededException, DeepLException
from easytl import GoogleAuthError, GoogleAPIError

##-------------------start-of-KudasaiException--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions modules/common/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from modules.common.file_ensurer import FileEnsurer
from modules.common.toolkit import Toolkit
from modules.common.exceptions import AuthenticationError, MaxBatchDurationExceededException, AuthorizationException, InternalServerError, RateLimitError, APITimeoutError, GoogleAuthError, APIStatusError, APIConnectionError, DeepLException, GoogleAPIError
from modules.common.exceptions import OpenAIAuthenticationError, MaxBatchDurationExceededException, DeepLAuthorizationException, OpenAIInternalServerError, OpenAIRateLimitError, OpenAIAPITimeoutError, GoogleAuthError, OpenAIAPIStatusError, OpenAIAPIConnectionError, DeepLException, GoogleAPIError
from modules.common.decorators import permission_error_decorator

##-------------------start-of-Translator--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -283,7 +283,7 @@ async def init_api_key(service:str, api_key_path:str, api_key_setter:typing.Call
FileEnsurer.standard_overwrite_file(api_key_path, base64.b64encode(api_key.encode('utf-8')).decode('utf-8'), omit=True)

## if invalid key exit
except (GoogleAuthError, AuthenticationError, AuthorizationException):
except (GoogleAuthError, OpenAIAuthenticationError, DeepLAuthorizationException):

Toolkit.clear_console()

Expand Down Expand Up @@ -437,7 +437,7 @@ async def commence_translation(is_webgui:bool=False) -> None:
Translator.deepl_formality = JsonHandler.current_translation_settings["deepl settings"]["deepl_formality"]

exception_dict = {
"openai": (AuthenticationError, InternalServerError, RateLimitError, APITimeoutError, APIConnectionError, APIStatusError),
"openai": (OpenAIAuthenticationError, OpenAIInternalServerError, OpenAIRateLimitError, OpenAIAPITimeoutError, OpenAIAPIConnectionError, OpenAIAPIStatusError),
"gemini": GoogleAPIError,
"deepl": DeepLException
}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
gradio==4.20.0
kairyou==1.5.0
easytl==0.3.3
easytl==0.4.0-alpha

0 comments on commit 71b0f92

Please sign in to comment.