shit koboldcpp

This commit is contained in:
恍兮惚兮 2024-06-23 01:09:39 +08:00
parent 366fbba286
commit 1e5a132abb

View File

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