From 060597a0a3bb3cbeecd2ec7ba0ffbb5e98351682 Mon Sep 17 00:00:00 2001 From: DazedAnon Date: Mon, 13 May 2024 15:33:05 -0500 Subject: [PATCH] Update pricing on gpt-4o rpgmakermv --- modules/regex.py | 3 ++- modules/rpgmakermvmz.py | 29 +++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/modules/regex.py b/modules/regex.py index 3de6417..ea91114 100644 --- a/modules/regex.py +++ b/modules/regex.py @@ -169,7 +169,7 @@ def translateRegex(data, pbar, filename, translatedList): if '#MSG,' in data[i] or '#MSG\n' in data[i] or voice == True: i += 1 # Speaker - if re.search(r'^ ?([^#\/."、。*!!()\(\)\[\] \n]+)\n', data[i]) and len(data[i]) < 25: + if re.search(r'^ ?([^#\/."、。*!!()\(\)\[\] \n]+)\n', data[i]) and len(data[i]) < 30: match = re.search(r'(.*)', data[i]) if match != None: speaker = match.group(1) @@ -180,6 +180,7 @@ def translateRegex(data, pbar, filename, translatedList): tokens[0] += response[1][0] tokens[1] += response[1][1] if translatedList != []: + speaker = speaker.replace(' ', '\u3000') data[i] = f'\u3000{speaker}\n' else: speaker = '' diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index 595cad9..43b9a71 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -45,9 +45,9 @@ if 'gpt-3.5' in MODEL: OUTPUTAPICOST = .002 BATCHSIZE = 10 FREQUENCY_PENALTY = 0.2 -elif 'gpt-4' in MODEL: - INPUTAPICOST = .01 - OUTPUTAPICOST = .03 +elif 'gpt-4o' in MODEL: + INPUTAPICOST = .005 + OUTPUTAPICOST = .015 BATCHSIZE = 20 FREQUENCY_PENALTY = 0.1 @@ -58,11 +58,11 @@ LEAVE = False # Dialogue / Scroll CODE401 = True -CODE405 = False +CODE405 = True CODE408 = False # Choices -CODE102 = False +CODE102 = True # Variables CODE122 = False @@ -1174,10 +1174,18 @@ def searchCodes(page, pbar, jobList, filename): continue # Force Speaker using var - if 'memerisu' in jaString.lower(): - speaker = 'Memerisu' - elif 'thina' in jaString.lower(): - speaker = 'Tina' + if 'ari' in jaString.lower(): + speaker = 'Arisa' + i += 1 + continue + elif 'riika' in jaString.lower(): + speaker = 'Rika' + i += 1 + continue + elif 'sutera' in jaString.lower(): + speaker = 'Stella' + i += 1 + continue # Get Speaker response = getSpeaker(jaString) @@ -2037,7 +2045,8 @@ def batchList(input_list, batch_size): def createContext(fullPromptFlag, subbedT): characters = 'Game Characters:\n\ -リーフ (Leaf) - Female\n\ +葵 (Aoi) - Female\n\ +豪山剛 (Tsuyoshi Gouyama) - Male\n\ ' system = PROMPT + VOCAB if fullPromptFlag else \