fix bnb loader

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-10-29 12:36:03 -04:00
parent 58220b6497
commit 7b150ba361
2 changed files with 3 additions and 3 deletions
+3 -1
View File
@@ -11,7 +11,7 @@ def create_bnb_config(kwargs):
from modules import shared, devices
if len(shared.opts.bnb_quantization) > 0:
if 'Model' in shared.opts.bnb_quantization and 'transformer' not in kwargs:
load_bnb('Load model')
load_bnb()
bnb_config = diffusers.BitsAndBytesConfig(
load_in_8bit=shared.opts.bnb_quantization_type in ['fp8'],
load_in_4bit=shared.opts.bnb_quantization_type in ['nf4', 'fp4'],
@@ -34,6 +34,8 @@ def load_bnb(msg='', silent=False):
try:
import bitsandbytes
bnb = bitsandbytes
diffusers.utils.import_utils._bitsandbytes_available = True # pylint: disable=protected-access
diffusers.utils.import_utils._bitsandbytes_version = '0.43.3' # pylint: disable=protected-access
return bnb
except Exception as e:
if len(msg) > 0: