mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
Move quant functions to model_quant.py
This commit is contained in:
+2
-2
@@ -64,12 +64,12 @@ def load_t5(name=None, cache_dir=None):
|
||||
t5 = transformers.T5EncoderModel.from_pretrained(repo_id, subfolder='text_encoder_3', quantization_config=quantization_config, cache_dir=cache_dir, torch_dtype=devices.dtype)
|
||||
elif 'qint8' in name.lower():
|
||||
model_quant.load_quanto('Load model: type=T5')
|
||||
from modules.sd_models_compile import optimum_quanto_model
|
||||
from modules.model_quant import optimum_quanto_model
|
||||
t5 = transformers.T5EncoderModel.from_pretrained(repo_id, subfolder='text_encoder_3', cache_dir=cache_dir, torch_dtype=devices.dtype)
|
||||
t5 = optimum_quanto_model(t5, weights="qint8", activations="none")
|
||||
elif 'int8' in name.lower():
|
||||
install('nncf==2.7.0', quiet=True)
|
||||
from modules.sd_models_compile import nncf_compress_model
|
||||
from modules.model_quant import nncf_compress_model
|
||||
from modules.sd_hijack import NNCF_T5DenseGatedActDense
|
||||
t5 = transformers.T5EncoderModel.from_pretrained(repo_id, subfolder='text_encoder_3', cache_dir=cache_dir, torch_dtype=devices.dtype)
|
||||
for i in range(len(t5.encoder.block)):
|
||||
|
||||
Reference in New Issue
Block a user