mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Patches: Make lazyload work on quantized
i wanna watch youtube while my model is loading without locking up my system >:(
This commit is contained in:
@@ -78,7 +78,6 @@ class model_backend(HFTorchInferenceModel):
|
||||
}
|
||||
|
||||
if self.use_4_bit:
|
||||
self.lazy_load = False
|
||||
tf_kwargs.update({
|
||||
"quantization_config":BitsAndBytesConfig(
|
||||
load_in_4bit=True,
|
||||
|
@@ -181,7 +181,7 @@ class LazyloadPatches:
|
||||
is_quantized = is_quantized or load_in_8bit
|
||||
|
||||
if is_quantized:
|
||||
from .utils.bitsandbytes import set_module_8bit_tensor_to_device
|
||||
from transformers.utils.bitsandbytes import set_module_quantized_tensor_to_device
|
||||
|
||||
error_msgs = []
|
||||
|
||||
@@ -299,7 +299,7 @@ class LazyloadPatches:
|
||||
fp16_statistics = None
|
||||
|
||||
if "SCB" not in param_name:
|
||||
set_module_8bit_tensor_to_device(
|
||||
set_module_quantized_tensor_to_device(
|
||||
model,
|
||||
param_name,
|
||||
param_device,
|
||||
|
Reference in New Issue
Block a user