From 77cf0c4554a34af0b2248a503bb05d71506cc373 Mon Sep 17 00:00:00 2001 From: DazedAnon Date: Thu, 10 Oct 2024 21:37:34 -0500 Subject: [PATCH] Fix history --- modules/rpgmakermvmz.py | 9 +++++---- vocab.txt | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index 17238cf..e04bf92 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -2127,7 +2127,7 @@ def searchCodes(page, pbar, jobList, filename): # 401 if len(list401) > 0: - response = translateGPT(list401, textHistory, True) + response = translateGPT(list401, "", True) list401TL = response[0] totalTokens[0] += response[1][0] totalTokens[1] += response[1][1] @@ -2740,7 +2740,8 @@ def translateGPT(text, history, fullPromptFlag): if not re.search(r"[一-龠ぁ-ゔァ-ヴーa-zA-Z0-9\uFF61-\uFF9F]+", subbedT): if PBAR is not None: PBAR.update(len(tItem)) - continue + history = tItem[-MAXHISTORY:] + continue # Create Message system, user = createContext(fullPromptFlag, subbedT, format) @@ -2785,10 +2786,10 @@ def translateGPT(text, history, fullPromptFlag): if mismatch == False: tList[index] = extractedTranslations history = extractedTranslations[ - -10: + -MAXHISTORY: ] # Update history if we have a list else: - history = text[-10:] + history = text[-MAXHISTORY:] mismatch = False if FILENAME not in MISMATCH: MISMATCH.append(FILENAME) diff --git a/vocab.txt b/vocab.txt index 9c29b02..2850669 100644 --- a/vocab.txt +++ b/vocab.txt @@ -112,4 +112,5 @@ ME 音量 (ME Volume) 堕天使 (Fallen Angel) 鬼 (Oni) ローバー (Roper) +w (lol) ``` \ No newline at end of file