Spaces:
Build error
Build error
Download utils/utils.py from Skomrakus/Autobloger-AI: direct link, hf CLI and curl.
- Browser
- Download file 368 Bytes
-
https://huggingface.co/spaces/Skomrakus/Autobloger-AI/resolve/main/utils/utils.py
- Command line
-
hf download hf://spaces/Skomrakus/Autobloger-AI/utils/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/Skomrakus/Autobloger-AI/resolve/main/utils/utils.py
368 Bytes
| import json | |
| def load_config(): | |
| with open("config.json", "r") as f: | |
| return json.load(f) | |
| def load_data(data_path): | |
| with open(data_path, "r") as f: | |
| return [line.strip() for line in f.readlines()] | |
| def save_results(results, output_path): | |
| with open(output_path, "w") as f: | |
| for result in results: | |
| f.write(str(result) + "\n") |