From 6e660188c2914c9ee8675eca579bfd7dd3d84e13 Mon Sep 17 00:00:00 2001 From: Smzh <129963508+HunterShenSmzh@users.noreply.github.com> Date: Wed, 19 Jun 2024 08:07:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnegativeprompt=E5=92=8Cmaxtok?= =?UTF-8?q?ens=E4=B8=8D=E8=83=BD=E7=94=A8=E7=9A=84=E6=83=85=E5=86=B5=20(#8?= =?UTF-8?q?29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 大意了,才发现没启用参数。 --- LunaTranslator/LunaTranslator/translator/TGW.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LunaTranslator/LunaTranslator/translator/TGW.py b/LunaTranslator/LunaTranslator/translator/TGW.py index 782ef070..64580fe7 100644 --- a/LunaTranslator/LunaTranslator/translator/TGW.py +++ b/LunaTranslator/LunaTranslator/translator/TGW.py @@ -79,6 +79,8 @@ class TS(basetrans): messages = self.make_messages(text, **kwargs) payload = { "messages": messages, + "max_tokens": self.config["max_tokens(单次生成上限)"], + "negative_prompt": self.config["negative_prompt(不懂可以不写)"], "temperature": self.config["temperature"], "stop": stop, "stream": False, @@ -122,6 +124,8 @@ class TS(basetrans): messages = self.make_messages(text, **kwargs) payload = { "messages": messages, + "max_tokens": self.config["max_tokens(单次生成上限)"], + "negative_prompt": self.config["negative_prompt(不懂可以不写)"], "temperature": self.config["temperature"], "stop": stop, "stream": True,