fixed broken json saving

This commit is contained in:
Looki2000 2023-11-13 23:07:20 +01:00
parent 815afe2e5f
commit ecc8b170b4

View File

@ -230,14 +230,16 @@ for line in dialog:
# next_file = "0.json" # next_file = "0.json"
#else: #else:
# next_file = str(max([int(f[:-5]) for f in files]) + 1) + ".json" # next_file = str(max([int(f[:-5]) for f in files]) + 1) + ".json"
#
#
## save to output_dialogs/next_file
#with open(root + "/output_dialogs/" + next_file, "w", encoding="utf-8") as f:
# json.dump(training_dict, f, indent=4, ensure_ascii=False)
next_file = datetime.now().strftime("%d-%m-%Y_%H-%M-%S") + ".json" next_file = datetime.now().strftime("%d-%m-%Y_%H-%M-%S") + ".json"
# save to output_dialogs/next_file
with open(root + "/output_dialogs/" + next_file, "w", encoding="utf-8") as f:
json.dump(training_dict, f, indent=4, ensure_ascii=False)