fix: Fix the estimate and system.json for ace

This commit is contained in:
Dazed 2023-04-23 20:48:27 -05:00
parent ae68cd198c
commit 04b7918e92
2 changed files with 2 additions and 17 deletions

View file

@ -645,26 +645,11 @@ def searchSystem(data, pbar):
if term != '@messages':
termList = data['@terms'][term]
for i in range(len(termList)): # Last item is a messages object
if termList[i] is not None:
if termList[i] is not None and 'json' not in term:
response = translateGPT(termList[i], context)
tokens += response[1]
termList[i] = response[0].strip('.\"')
pbar.update(1)
# Messages
messages = (data['@terms']['@messages'])
for key, value in messages.items():
response = translateGPT(value, 'Reply with only the english translated answer')
translatedText = response[0]
# Remove characters that may break scripts
charList = ['.', '\"', '\\n']
for char in charList:
translatedText = translatedText.replace(char, '')
tokens += response[1]
messages[key] = translatedText
pbar.update(1)
return tokens

View file

@ -140,7 +140,7 @@ def getResultString(translatedData, translationTime, filename):
try:
raise translatedData[2]
except Exception as e:
errorString = str(e) + Fore.RED
errorString = str(e) + '|' + translatedData[3] + Fore.RED
return filename + ': ' + tokenString + timeString + Fore.RED + u' \u2717 ' +\
errorString + Fore.RESET