Spaces:
Paused
Paused
Download agent_zero_framework/prepare.py from Oldmangrizzz/Agent-Node: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/prepare.py
- Command line
-
hf download hf://spaces/Oldmangrizzz/Agent-Node/agent_zero_framework/prepare.py
-
curl -L -o prepare.py https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/prepare.py
617 Bytes
| from python.helpers import dotenv, runtime, settings | |
| import string | |
| import random | |
| from python.helpers.print_style import PrintStyle | |
| PrintStyle.standard("Preparing environment...") | |
| try: | |
| runtime.initialize() | |
| # generate random root password if not set (for SSH) | |
| root_pass = dotenv.get_dotenv_value(dotenv.KEY_ROOT_PASSWORD) | |
| if not root_pass: | |
| root_pass = "".join(random.choices(string.ascii_letters + string.digits, k=32)) | |
| PrintStyle.standard("Changing root password...") | |
| settings.set_root_password(root_pass) | |
| except Exception as e: | |
| PrintStyle.error(f"Error in preload: {e}") | |