mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
f2d9473ffe
commit
eb1f499ce4
@ -342,12 +342,16 @@ class basetrans(commonbase):
|
||||
for _ in optimization_params:
|
||||
if isinstance(_, dict):
|
||||
_gpt_dict = _.get("gpt_dict", None)
|
||||
if not _gpt_dict:
|
||||
if _gpt_dict is None:
|
||||
continue
|
||||
gpt_dict = _gpt_dict
|
||||
|
||||
contentsolved = json.dumps(
|
||||
{"text": contentsolved, "gpt_dict": gpt_dict}
|
||||
{
|
||||
"text": contentsolved,
|
||||
"gpt_dict": gpt_dict,
|
||||
"contentraw": contentraw,
|
||||
}
|
||||
)
|
||||
|
||||
func = functools.partial(
|
||||
|
@ -194,7 +194,10 @@ class TS(basetrans):
|
||||
def translate(self, query):
|
||||
query = json.loads(query)
|
||||
gpt_dict = query["gpt_dict"]
|
||||
contentraw = query["contentraw"]
|
||||
query = query["text"]
|
||||
if gpt_dict is not None:
|
||||
query = contentraw
|
||||
self.checkempty(["API接口地址"])
|
||||
self.get_client(self.config["API接口地址"])
|
||||
frequency_penalty = float(self.config["frequency_penalty"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user