diff --git a/python/model/TencentCloud.py b/python/model/TencentCloud.py index ebf666c..279fc61 100644 --- a/python/model/TencentCloud.py +++ b/python/model/TencentCloud.py @@ -15,10 +15,12 @@ class TencentCloud(TranslateParent): def translate_text_with_ai(self, goto_translate_map: dict, target_language: str = "zh") -> dict: # AI大模型翻译 return_false_code = {"status": False, "code": 10500} + if len(goto_translate_map) == 0: + return {"status": True, "translate_map": {}} use_model = "hunyuan-translation" rebuild_text = "" rebuild_list = [] - use_field = "AI/SD generated image prompt" + use_field = "AI/SD generated image prompt, Do not reduce or increase any punctuation" for one_prompt in goto_translate_map.keys(): rebuild_list.append(one_prompt) rebuild_text += f"{one_prompt}, " @@ -49,7 +51,7 @@ class TencentCloud(TranslateParent): return return_false_code else: if len(translate_prompt_list) != len(goto_translate_map): - print("翻译结果不匹配") + print("翻译结果不匹配: ", len(translate_prompt_list), len(goto_translate_map)) print("source", list(goto_translate_map.keys())) print("translate", translate_prompt_list) return_false_code.update({"code": 10502}) # 翻译结果不匹配 diff --git a/python/routers/translate_with_ai.py b/python/routers/translate_with_ai.py index 70a0b7d..c0a44d0 100644 --- a/python/routers/translate_with_ai.py +++ b/python/routers/translate_with_ai.py @@ -86,7 +86,7 @@ class OverwriteServerHandler(ServerHandler): match request_handler.translate_model: case "TencentModelAI": - tencent_cloud: TranslateParent = TencentCloud() + tencent_cloud: TencentCloud = TencentCloud() response_dict: dict = tencent_cloud.translate_text_with_ai(goto_translate_map=goto_ai_translate_map) translate_network_map: dict = response_dict["translate_map"] case _: diff --git a/view-ui-project-vite-main/src/views/TableVersion.vue b/view-ui-project-vite-main/src/views/TableVersion.vue index 0539d58..81a79e4 100644 --- a/view-ui-project-vite-main/src/views/TableVersion.vue +++ b/view-ui-project-vite-main/src/views/TableVersion.vue @@ -71,7 +71,7 @@