Spaces:
Sleeping
Sleeping
Download runtime_setup.py from nhdang117/ToxicScope: direct link, hf CLI and curl.
- Browser
- Download file 407 Bytes
-
https://huggingface.co/spaces/nhdang117/ToxicScope/resolve/main/runtime_setup.py
- Command line
-
hf download hf://spaces/nhdang117/ToxicScope/runtime_setup.py
-
curl -L -o runtime_setup.py https://huggingface.co/spaces/nhdang117/ToxicScope/resolve/main/runtime_setup.py
407 Bytes
| """Make an optional portable JRE visible without changing the system PATH.""" | |
| from pathlib import Path | |
| import os, shutil | |
| def activate_java(): | |
| if shutil.which('java'): return True | |
| root=Path(__file__).resolve().parent/'runtime/java' | |
| for binary in root.glob('*/bin/java.exe'): | |
| os.environ['PATH']=str(binary.parent)+os.pathsep+os.environ.get('PATH','') | |
| return True | |
| return False | |