Spaces:
Running on Zero
Running on Zero
Download backend/runtime_setup.py from fffiloni/idol-commons: direct link, hf CLI and curl.
- Browser
- Download file 757 Bytes
-
https://huggingface.co/spaces/fffiloni/idol-commons/resolve/main/backend/runtime_setup.py
- Command line
-
hf download hf://spaces/fffiloni/idol-commons/backend/runtime_setup.py
-
curl -L -o runtime_setup.py https://huggingface.co/spaces/fffiloni/idol-commons/resolve/main/backend/runtime_setup.py
757 Bytes
| """Operator build bootstrap, never called with user-provided commands or URLs.""" | |
| import os,subprocess | |
| from .settings import ROOT | |
| def ensure_renderer(): | |
| if not (ROOT/'frontend/dist/render.html').is_file():raise RuntimeError('Build the frontend before enabling IDOL.') | |
| if not (ROOT/'frontend/node_modules/playwright/package.json').is_file(): | |
| subprocess.run(['npm','ci','--ignore-scripts','--prefix',str(ROOT/'frontend')],check=True,timeout=180) | |
| browser=os.getenv('CHROMIUM_EXECUTABLE','') | |
| if not browser or not os.path.isfile(browser):raise RuntimeError('Configure an installed Chromium before enabling IDOL.') | |
| if not os.path.isdir('/proc'):raise RuntimeError('The preview runtime must support process-group memory accounting.') | |