Download augmentoolkit/utils/write_output_to_file.py from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 440 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/augmentoolkit/utils/write_output_to_file.py
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/augmentoolkit/utils/write_output_to_file.py
-
curl -L -o write_output_to_file.py https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/augmentoolkit/utils/write_output_to_file.py
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}") | |