Spaces:
Paused
Paused
Download custom_utils/setup_env.py from qbhf2/GarmentCode: direct link, hf CLI and curl.
- Browser
- Download file 743 Bytes
-
https://huggingface.co/spaces/qbhf2/GarmentCode/resolve/main/custom_utils/setup_env.py
- Command line
-
hf download hf://spaces/qbhf2/GarmentCode/custom_utils/setup_env.py
-
curl -L -o setup_env.py https://huggingface.co/spaces/qbhf2/GarmentCode/resolve/main/custom_utils/setup_env.py
743 Bytes
| import subprocess | |
| import os | |
| # Запуск setup.sh для настройки окружения и source ~/.bashrc | |
| def run_setup_script(): | |
| setup_script_path = os.path.join(os.path.dirname(__file__), "startup.sh") | |
| try: | |
| print("Running setup script...") | |
| # Выполнить setup.sh и source ~/.bashrc в одной сессии bash | |
| subprocess.run( | |
| f"bash -c 'source ~/.bashrc && bash {setup_script_path}'", | |
| shell=True, | |
| check=True, | |
| ) | |
| print("Setup script and environment initialization completed successfully!") | |
| except subprocess.CalledProcessError as e: | |
| print(f"Error while running setup script or sourcing .bashrc: {e}") | |
| exit(1) |