Fix max_tokens setting not working for TextGenWebui translator (#828)

* Fix max_tokens setting not working for TextGenWebui translator

Added "max_tokens": self.config["max_tokens"].

* Update translatorsetting.json
This commit is contained in:
Guanghua Lu 2024-06-18 15:24:11 +08:00 committed by GitHub
parent cb00a8f2b0
commit 1f410e4714
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -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"],

View File

@ -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,