From 7d5f88d5cecafc01076770ecef63cb2fe2005e2c Mon Sep 17 00:00:00 2001 From: dazedanon Date: Thu, 7 Aug 2025 16:48:42 -0500 Subject: [PATCH] Fall back to 4.1 or 4o when refused --- util/translation.py | 6 ++---- vocab.txt | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/util/translation.py b/util/translation.py index 067cbe3..d81cc16 100644 --- a/util/translation.py +++ b/util/translation.py @@ -218,8 +218,6 @@ def translateText(system, user, history, penalty, formatType, model): # Content to TL msg.append({"role": "user", "content": f"```\n{user}\n```"}) response = openai.chat.completions.create( - temperature=0, - frequency_penalty=penalty, model=model, response_format=responseFormat, messages=msg, @@ -389,10 +387,10 @@ def translateAI(text, history, fullPromptFlag, config, filename=None, pbar=None, translatedText = response.choices[0].message.content # Retry if AI refused - if not translatedText: + if not translatedText or '"error":' in translatedText: response = translateText( f"{system}\n You translate ALL content.", - user, history, 0.1, formatType, "gpt-4o" + user, history, 0.1, formatType, "gpt-4.1" if config.model == "gpt-5" else "gpt-4o" ) translatedText = response.choices[0].message.content diff --git a/vocab.txt b/vocab.txt index 1bccbda..464cc0b 100644 --- a/vocab.txt +++ b/vocab.txt @@ -5,6 +5,7 @@ Here are some vocabulary and terms so that you know the proper spelling and tran ユキノ (Yukino) - Female ツバサ (Tsubasa) - Female ハルカ (Haruka) - Female +まゆ (Mayu) - Female # Lewd Terms マンコ (pussy)