diff --git a/LunaTranslator/LunaTranslator/translator/TGW.py b/LunaTranslator/LunaTranslator/translator/TGW.py index 782ef070..7a5573b5 100644 --- a/LunaTranslator/LunaTranslator/translator/TGW.py +++ b/LunaTranslator/LunaTranslator/translator/TGW.py @@ -89,6 +89,7 @@ class TS(basetrans): "top_p": self.config["top_p"], "min_p": self.config["min_p"], "top_k": self.config["top_k"], + "max_tokens": self.config["max_tokens"], "num_beams": self.config["num_beams"], "repetition_penalty": self.config["repetition_penalty"], "repetition_penalty_range": self.config["repetition_penalty_range"], @@ -132,6 +133,7 @@ class TS(basetrans): "top_p": self.config["top_p"], "min_p": self.config["min_p"], "top_k": self.config["top_k"], + "max_tokens": self.config["max_tokens"], "num_beams": self.config["num_beams"], "repetition_penalty": self.config["repetition_penalty"], "repetition_penalty_range": self.config["repetition_penalty_range"], diff --git a/LunaTranslator/files/defaultconfig/translatorsetting.json b/LunaTranslator/files/defaultconfig/translatorsetting.json index 4dc4bc8b..8959e290 100644 --- a/LunaTranslator/files/defaultconfig/translatorsetting.json +++ b/LunaTranslator/files/defaultconfig/translatorsetting.json @@ -718,7 +718,7 @@ "prompt(文本起始)": "将这段文本直接翻译成中文,不要进行任何额外的格式修改,这里是你需要翻译的文本:", "negative_prompt(不懂可以不写)": "", "stop(自定义停止符,多个用逗号隔开)": "", - "max_tokens(单次生成上限)": 200, + "max_tokens": 200, "instruction_template(需要按照模型模板选择)": "", "mode": "instruct", "temperature": 0.6, @@ -762,7 +762,7 @@ "max": 32, "step": 1 }, - "max_tokens(单次生成上限)": { + "max_tokens": { "type": "intspin", "min": 1, "max": 2048, @@ -879,4 +879,4 @@ } } } -} \ No newline at end of file +}