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