Update the scripts

This commit is contained in:
Dazed 2023-09-18 04:52:30 -05:00
parent ac3e8a16b0
commit cabaf9f82a
3 changed files with 532 additions and 290 deletions

View file

@ -9,7 +9,7 @@ from modules.rpgmakerace import handleACE
from modules.csvtl import handleCSV
from modules.textfile import handleTextfile
THREADS = 10 # For GPT4 rate limit will be hit if you have more than 1 thread.
THREADS = 20 # For GPT4 rate limit will be hit if you have more than 1 thread.
# Info Message
print(Fore.LIGHTYELLOW_EX + "WARNING: Once a translation starts do not close it unless you want to lose your\
@ -88,9 +88,10 @@ def main():
case _:
version = ''
if estimate == False and totalCost != 'Fail':
# This is to encourage people to grab what's in /translated instead
deleteFolderFiles('files')
if totalCost != 'Fail':
if estimate == False:
# This is to encourage people to grab what's in /translated instead
deleteFolderFiles('files')
# Prevent immediately closing of CLI
print(totalCost)

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,7 @@ PROMPT = Path('prompt.txt').read_text(encoding='utf-8')
THREADS = 10 # For GPT4 rate limit will be hit if you have more than 1 thread.
LOCK = threading.Lock()
WIDTH = 40
LISTWIDTH = 70
LISTWIDTH = 60
MAXHISTORY = 10
ESTIMATE = ''
TOTALCOST = 0
@ -67,7 +67,8 @@ def handleMVMZ(filename, estimate):
# Print Result
end = time.time()
tqdm.write(getResultString(['', TOKENS, None], end - start, filename))
tqdm.write(str(NAMESLIST))
if NAMES == True:
tqdm.write(str(NAMESLIST))
with LOCK:
TOTALCOST += TOKENS * .001 * APICOST
TOTALTOKENS += TOKENS
@ -559,7 +560,7 @@ def searchCodes(page, pbar):
codeList[j]['code'] = code
# Put names in list
if NAMES == True and speaker not in NAMESLIST:
if speaker not in NAMESLIST:
with LOCK:
NAMESLIST.append(speaker)
elif '\\kw' in finalJAString:
@ -821,7 +822,7 @@ def searchCodes(page, pbar):
# Set Data
speaker = translatedText
codeList[i]['parameters'][4] = translatedText
if NAMES == True and speaker not in NAMESLIST:
if speaker not in NAMESLIST:
with LOCK:
NAMESLIST.append(speaker)