Possible fix for csv

This commit is contained in:
Dazed 2024-01-12 05:14:00 -06:00
parent ac9fd2f12f
commit ca578dc874
2 changed files with 10 additions and 10 deletions

View file

@ -280,15 +280,15 @@ def translateCSV(reader, pbar, writer, textHistory, format):
if len(translatedTextList) != len(payload):
pbar.write(f'Mismatch Error: {i-BATCHSIZE}-{i}')
batch.clear()
# Set Data
j = i - len(batch)
for row in translatedTextList:
row = row.replace('"', '\\"')
row = row.replace(',', '\,')
data[j][1] = row
j += 1
batch.clear()
else:
# Set Data
j = i - len(batch)
for row in translatedTextList:
row = row.replace('"', '\\"')
row = row.replace(',', '\,')
data[j][1] = row
j += 1
batch.clear()
# Write all Data
with LOCK:

View file

@ -48,7 +48,7 @@ if 'gpt-3.5' in MODEL:
elif 'gpt-4' in MODEL:
INPUTAPICOST = .01
OUTPUTAPICOST = .03
BATCHSIZE = 4
BATCHSIZE = 40
FREQUENCY_PENALTY = 0.1
#tqdm Globals