From 4a6d2a77f7713ba9df01ca0ea79780a42df3a034 Mon Sep 17 00:00:00 2001 From: mnjnhuang <1090031856@qq.com> Date: Fri, 16 Jan 2026 17:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=88=B6=E7=B1=BB=E5=90=8D?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/model/BaiduCloud.py | 4 ++-- python/model/NiuTrans.py | 4 ++-- python/model/TencentCloud.py | 5 ++--- python/model/{TranslateModel.py => TranslateBaseModel.py} | 2 +- python/model/VolcEngine.py | 1 + 5 files changed, 8 insertions(+), 8 deletions(-) rename python/model/{TranslateModel.py => TranslateBaseModel.py} (99%) diff --git a/python/model/BaiduCloud.py b/python/model/BaiduCloud.py index f741419..a365dbe 100644 --- a/python/model/BaiduCloud.py +++ b/python/model/BaiduCloud.py @@ -1,9 +1,9 @@ import requests import json -from model.TranslateModel import TranslateModel +from model.TranslateBaseModel import TranslateBaseModel -class BaiduCloud(TranslateModel): +class BaiduCloud(TranslateBaseModel): def translate_text_with_machine(self, goto_translate_map: dict, source_language: str = "en", target_language: str = "zh") -> dict: if len(goto_translate_map) == 0: diff --git a/python/model/NiuTrans.py b/python/model/NiuTrans.py index ccaaaa6..c8c71d3 100644 --- a/python/model/NiuTrans.py +++ b/python/model/NiuTrans.py @@ -2,10 +2,10 @@ import requests import json import hashlib import time -from model.TranslateModel import TranslateModel +from model.TranslateBaseModel import TranslateBaseModel -class NiuTrans(TranslateModel): +class NiuTrans(TranslateBaseModel): def translate_text_with_machine(self, goto_translate_map: dict, source_language: str = "en", target_language: str = "zh") -> dict: if len(goto_translate_map) == 0: diff --git a/python/model/TencentCloud.py b/python/model/TencentCloud.py index f383e43..a9754e1 100644 --- a/python/model/TencentCloud.py +++ b/python/model/TencentCloud.py @@ -3,11 +3,10 @@ from tencentcloud.common import credential from tencentcloud.tmt.v20180321 import tmt_client, models as tmt_models from tencentcloud.hunyuan.v20230901 import hunyuan_client, models as hunyuan_models from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException -from model.TranslateModel import TranslateModel +from model.TranslateBaseModel import TranslateBaseModel -class TencentCloud(TranslateModel): - +class TencentCloud(TranslateBaseModel): def __init__(self, ): from main import server self.api_id, self.api_key = server.tell_tencent_api() diff --git a/python/model/TranslateModel.py b/python/model/TranslateBaseModel.py similarity index 99% rename from python/model/TranslateModel.py rename to python/model/TranslateBaseModel.py index 6317adc..27e8b98 100644 --- a/python/model/TranslateModel.py +++ b/python/model/TranslateBaseModel.py @@ -1,7 +1,7 @@ from abc import abstractmethod, ABC -class TranslateModel(ABC): +class TranslateBaseModel(ABC): @abstractmethod def translate_text_with_machine(self, goto_translate_map: dict, source_language: str = "en", diff --git a/python/model/VolcEngine.py b/python/model/VolcEngine.py index 802274e..a417214 100644 --- a/python/model/VolcEngine.py +++ b/python/model/VolcEngine.py @@ -2,6 +2,7 @@ import volcenginesdkcore import volcenginesdktranslate20250301 from volcenginesdkcore.rest import ApiException from abstract_class.TranslateParent import TranslateParent +from model.TranslateBaseModel import TranslateBaseModel from concurrent.futures import ThreadPoolExecutor, as_completed