Add torch_dtype to transformer.from_single_file

This commit is contained in:
Disty0
2025-08-11 23:37:05 +03:00
parent 6312b3d0ac
commit 9daa30f371
+2
View File
@@ -37,6 +37,8 @@ def load_transformer(repo_id, cls_name, load_config={}, subfolder="transformer",
transformer = model_quant.do_post_load_quant(transformer, allow=quant_type is not None)
elif local_file is not None and local_file.lower().endswith('.safetensors'):
shared.log.debug(f'Load model: transformer="{local_file}" cls={cls_name.__name__} quant="{quant_type}" args={load_args}')
if dtype is not None:
load_args['torch_dtype'] = dtype
loader = cls_name.from_single_file if hasattr(cls_name, 'from_single_file') else cls_name.from_pretrained
transformer = loader(
local_file,