Meaning, you can move the import to within that if loaded_in_8bit, and thus make bitsandbytes only required when 8bit models are loaded.
I suggest this because on the text-gen-webui Discord I've been hearing so many users complain about the difficulty of getting bitsandbytes installed on Windows, and that's been renewed by monkey-patch requiring it... but it should be simple to remove the explicit dependency, if I'm not missing anything.
If I'm not mistaken,
bitsandbytes
is only used for this one line: https://github.com/johnsmith0031/alpaca_lora_4bit/blob/main/monkeypatch/peft_tuners_lora_monkey_patch.py#L125Meaning, you can move the
import
to within thatif loaded_in_8bit
, and thus make bitsandbytes only required when 8bit models are loaded.I suggest this because on the text-gen-webui Discord I've been hearing so many users complain about the difficulty of getting bitsandbytes installed on Windows, and that's been renewed by monkey-patch requiring it... but it should be simple to remove the explicit dependency, if I'm not missing anything.