Download modules_forge/bnb_installer.py from airomix/SDF: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/airomix/SDF/resolve/main/modules_forge/bnb_installer.py
- Command line
-
hf download hf://airomix/SDF/modules_forge/bnb_installer.py
-
curl -L -o bnb_installer.py https://huggingface.co/airomix/SDF/resolve/main/modules_forge/bnb_installer.py
612 Bytes
| import pkg_resources | |
| from modules.launch_utils import run_pip | |
| target_bitsandbytes_version = '0.43.3' | |
| def try_install_bnb(): | |
| try: | |
| bitsandbytes_version = pkg_resources.get_distribution('bitsandbytes').version | |
| except Exception: | |
| bitsandbytes_version = None | |
| try: | |
| if bitsandbytes_version != target_bitsandbytes_version: | |
| run_pip( | |
| f"install -U bitsandbytes=={target_bitsandbytes_version}", | |
| f"bitsandbytes=={target_bitsandbytes_version}", | |
| ) | |
| except Exception as e: | |
| print(f'Cannot install bitsandbytes. Skipped.') | |