agent-0 / augmentoolkit /utils /write_output_to_file.py
Leon4gr45's picture
Upload folder using huggingface_hub
42da440 verified
Raw History Blame Contribute Delete
440 Bytes
import os
def write_output_to_file(output, directory, uuid):
# Ensure directory exists
if not os.path.exists(directory):
os.makedirs(directory)
# Define the file path using the directory and UUID
file_path = os.path.join(directory, f"{uuid}.yaml")
# Write the output to the file
with open(file_path, "w", encoding="utf-8") as file:
file.write(output)
print(f"Output written to {file_path}")