From de7441719d80d6458ff2f6cda47aae3a179a5dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 19 Jun 2024 08:07:23 +0800 Subject: [PATCH] Revert "Fix max_tokens setting not working for TextGenWebui translator (#828)" This reverts commit 1f410e471414d190c506f915a959c892a2771ef2. --- LunaTranslator/LunaTranslator/translator/TGW.py | 2 -- LunaTranslator/files/defaultconfig/translatorsetting.json | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/LunaTranslator/LunaTranslator/translator/TGW.py b/LunaTranslator/LunaTranslator/translator/TGW.py index 7a5573b5..782ef070 100644 --- a/LunaTranslator/LunaTranslator/translator/TGW.py +++ b/LunaTranslator/LunaTranslator/translator/TGW.py @@ -89,7 +89,6 @@ 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"], @@ -133,7 +132,6 @@ 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 8959e290..4dc4bc8b 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