From 3cd5ec5e93e4fc6d0f8d08b9a76b639dda2c86f3 Mon Sep 17 00:00:00 2001 From: knc6 Date: Tue, 17 Sep 2024 10:07:50 -0500 Subject: [PATCH] CSV writer fix. --- atomgpt/inverse_models/inverse_models.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/atomgpt/inverse_models/inverse_models.py b/atomgpt/inverse_models/inverse_models.py index add3ea9..5ee4f41 100644 --- a/atomgpt/inverse_models/inverse_models.py +++ b/atomgpt/inverse_models/inverse_models.py @@ -46,8 +46,6 @@ class TrainingPropConfig(BaseSettings): model_save_path: str = "lora_model_m" - - instruction = "Below is a description of a superconductor material." # model_save_path = "lora_model_m" @@ -346,8 +344,15 @@ def run_atomgpt_inverse(config_file="config.json"): print("target_mat", target_mat) print("genmat", gen_mat) # print(target_mat.composition.reduced_formula,gen_mat.composition.reduced_formula,target_mat.density,gen_mat.density ) - # line = i['id']+","+Poscar(target_mat).to_string().replace('\n','\\n')+","+Poscar(gen_mat).to_string().replace('\n','\\n')+"\n" - # f.write(line) + line = ( + i["id"] + + "," + + Poscar(target_mat).to_string().replace("\n", "\\n") + + "," + + Poscar(gen_mat).to_string().replace("\n", "\\n") + + "\n" + ) + f.write(line) print() f.close()