From 5af1fb43d8b2851673fbaa40b95cc5b7e3463cf4 Mon Sep 17 00:00:00 2001 From: Dazed Date: Wed, 3 Jan 2024 14:25:54 -0600 Subject: [PATCH] Fix critical mvmz bug --- modules/rpgmakermvmz.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index 2bf4ca3..2d93550 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -46,7 +46,7 @@ if 'gpt-3.5' in MODEL: elif 'gpt-4' in MODEL: INPUTAPICOST = .01 OUTPUTAPICOST = .03 - BATCHSIZE = 5 + BATCHSIZE = 40 FREQUENCY_PENALTY = 0.1 #tqdm Globals @@ -640,16 +640,6 @@ def searchCodes(page, pbar, fillList, filename): if finalJAString == '': continue - # If there isn't any Japanese in the text just skip - if IGNORETLTEXT is True: - if not re.search(r'[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+', finalJAString): - # Keep textHistory list at length maxHistory - textHistory.append('\"' + finalJAString + '\"') - if len(textHistory) > maxHistory: - textHistory.pop(0) - currentGroup = [] - continue - # Check for speakers in String # \\n nCase = None @@ -768,6 +758,16 @@ def searchCodes(page, pbar, fillList, filename): finalJAString = finalJAString.replace('\\CL', '') CLFlag = True + # If there isn't any Japanese in the text just skip + if IGNORETLTEXT is True: + if not re.search(r'[一-龠]+|[ぁ-ゔ]+|[ァ-ヴー]+', finalJAString): + # Keep textHistory list at length maxHistory + textHistory.append('\"' + finalJAString + '\"') + if len(textHistory) > maxHistory: + textHistory.pop(0) + currentGroup = [] + continue + # 1st Passthrough (Grabbing Data) if len(fillList) == 0: if speaker == '' and finalJAString != '': @@ -821,8 +821,6 @@ def searchCodes(page, pbar, fillList, filename): # Set Data if speakerID != None: codeList[speakerID]['parameters'] = [fullSpeaker] - codeList[i]['parameters'] = [] - codeList[i]['code'] = -1 codeList[j]['parameters'] = [translatedText] codeList[j]['code'] = code speaker = ''