Spaces:
Runtime error
Runtime error
Fix bnb Params4bit.shape tuple (.numel via math.prod); unpin bitsandbytes for cu130
Browse filesFiles changed (2)
15 unmodified lines161718192021187 unmodified lines20921021121221321421515 unmodified lineshttps://github.com/huggingface/transformers/blob/c409cd81777fb27aadc043ed3d8339dbc020fb3b/src/transformers/quantizers/quantizer_bnb_4bit.py"""from typing import TYPE_CHECKING, Anyfrom ...utils import get_module_from_name187 unmodified linescurrent_param_shape = current_param.shapeloaded_param_shape = loaded_param.shapen = current_param_shape.numel()inferred_shape = (n,) if "bias" in param_name else ((n + 1) // 2, 1)if loaded_param_shape != inferred_shape:raise ValueError(15 unmodified lines16171819202122187 unmodified lines21021121221321421521621715 unmodified lineshttps://github.com/huggingface/transformers/blob/c409cd81777fb27aadc043ed3d8339dbc020fb3b/src/transformers/quantizers/quantizer_bnb_4bit.py"""import mathfrom typing import TYPE_CHECKING, Anyfrom ...utils import get_module_from_name187 unmodified linescurrent_param_shape = current_param.shapeloaded_param_shape = loaded_param.shape# newer bitsandbytes returns Params4bit.shape as a plain tuple (no .numel()); math.prod handles both.n = math.prod(current_param_shape)inferred_shape = (n,) if "bias" in param_name else ((n + 1) // 2, 1)if loaded_param_shape != inferred_shape:raise ValueError(
1234567transformers==5.8.0peft==0.19.1accelerate==1.10.1bitsandbytes==0.47.0sentencepieceoutlines==1.3.0pydantic>=21234567transformers==5.8.0peft==0.19.1accelerate==1.10.1bitsandbytessentencepieceoutlines==1.3.0pydantic>=2
diffusers_src/src/diffusers/quantizers/bitsandbytes/bnb_quantizer.py+3-1
requirements.txt+1-1