From a619cd6114f47d66ddce32453f01f04d0942ba74 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Thu, 15 May 2025 12:38:54 +0900 Subject: [PATCH] [update] Upgrade deepl package version to 1.22.0 and refactor translation code to use DeepLClient --- requirements.txt | 2 +- requirements_cuda.txt | 2 +- src-python/models/translation/translation_translator.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index b384b8a0..93733326 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ transformers==4.40.2 pillow == 10.0.0 PyAudioWPatch == 0.2.12.6 python-osc == 1.9.0 -deepl == 1.15.0 +deepl == 1.22.0 flashtext ==2.7 pyinstaller==6.10.0 numpy==1.26.4 diff --git a/requirements_cuda.txt b/requirements_cuda.txt index 8642db8b..898364b7 100644 --- a/requirements_cuda.txt +++ b/requirements_cuda.txt @@ -6,7 +6,7 @@ transformers==4.40.2 pillow == 10.0.0 PyAudioWPatch == 0.2.12.6 python-osc == 1.9.0 -deepl == 1.15.0 +deepl == 1.22.0 flashtext ==2.7 pyinstaller==6.10.0 numpy==1.26.4 diff --git a/src-python/models/translation/translation_translator.py b/src-python/models/translation/translation_translator.py index b9031c6c..42eb828e 100644 --- a/src-python/models/translation/translation_translator.py +++ b/src-python/models/translation/translation_translator.py @@ -1,5 +1,5 @@ from os import path as os_path -from deepl import Translator as deepl_Translator +from deepl import DeepLClient try: from translators import translate_text as other_web_Translator ENABLE_TRANSLATORS = True @@ -28,7 +28,7 @@ class Translator(): def authenticationDeepLAuthKey(self, authkey): result = True try: - self.deepl_client = deepl_Translator(authkey) + self.deepl_client = DeepLClient(authkey) self.deepl_client.translate_text(" ", target_lang="EN-US") except Exception: errorLogging()