修改父类名字
This commit is contained in:
parent
2eddaf3ef2
commit
4a6d2a77f7
@ -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:
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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",
|
||||
@ -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
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user