From ecc8b170b4dcd7c8f637112d68d9e95611ddabb5 Mon Sep 17 00:00:00 2001 From: Looki2000 Date: Mon, 13 Nov 2023 23:07:20 +0100 Subject: [PATCH] fixed broken json saving --- finetune_dialogs_tool/main.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/finetune_dialogs_tool/main.py b/finetune_dialogs_tool/main.py index 43314ce..14a3c6b 100644 --- a/finetune_dialogs_tool/main.py +++ b/finetune_dialogs_tool/main.py @@ -230,14 +230,16 @@ for line in dialog: # next_file = "0.json" #else: # 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" +# 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) + + +