mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
shit koboldcpp
This commit is contained in:
parent
366fbba286
commit
1e5a132abb
@ -85,7 +85,7 @@ class gptcommon(basetrans):
|
|||||||
# optional
|
# optional
|
||||||
max_tokens=self.config["max_tokens"],
|
max_tokens=self.config["max_tokens"],
|
||||||
n=1,
|
n=1,
|
||||||
stop=None,
|
# stop=None,
|
||||||
top_p=self.config["top_p"],
|
top_p=self.config["top_p"],
|
||||||
temperature=temperature,
|
temperature=temperature,
|
||||||
frequency_penalty=self.config["frequency_penalty"],
|
frequency_penalty=self.config["frequency_penalty"],
|
||||||
@ -106,7 +106,8 @@ class gptcommon(basetrans):
|
|||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
json_data = json.loads(response_data[6:])
|
json_data = json.loads(response_data[6:])
|
||||||
if json_data["choices"][0]["finish_reason"]:
|
rs = json_data["choices"][0]["finish_reason"]
|
||||||
|
if rs and rs != "null":
|
||||||
break
|
break
|
||||||
msg = json_data["choices"][0]["delta"]["content"]
|
msg = json_data["choices"][0]["delta"]["content"]
|
||||||
yield msg
|
yield msg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user