@@ -177,7 +177,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
177177 revision (`str`, *optional*, defaults to `"main"`):
178178 The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
179179 allowed by Git.
180- no_mmap ('bool', *optional*, defaults to 'False'):
180+ disable_mmap ('bool', *optional*, defaults to 'False'):
181181 Whether to disable mmap when loading a Safetensors model. This option can perform better when the model
182182 is on a network mount or hard drive, which may not handle the seeky-ness of mmap very well.
183183 kwargs (remaining dictionary of keyword arguments, *optional*):
@@ -226,7 +226,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
226226 torch_dtype = kwargs .pop ("torch_dtype" , None )
227227 quantization_config = kwargs .pop ("quantization_config" , None )
228228 device = kwargs .pop ("device" , None )
229- no_mmap = kwargs .pop ("no_mmap " , False )
229+ disable_mmap = kwargs .pop ("disable_mmap " , False )
230230
231231 if isinstance (pretrained_model_link_or_path_or_dict , dict ):
232232 checkpoint = pretrained_model_link_or_path_or_dict
@@ -239,7 +239,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
239239 cache_dir = cache_dir ,
240240 local_files_only = local_files_only ,
241241 revision = revision ,
242- no_mmap = no_mmap ,
242+ disable_mmap = disable_mmap ,
243243 )
244244 if quantization_config is not None :
245245 hf_quantizer = DiffusersAutoQuantizer .from_config (quantization_config )
@@ -361,7 +361,9 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
361361 )
362362
363363 else :
364- _ , unexpected_keys = model .load_state_dict (diffusers_format_checkpoint , strict = False , no_mmap = no_mmap )
364+ _ , unexpected_keys = model .load_state_dict (
365+ diffusers_format_checkpoint , strict = False , disable_mmap = disable_mmap
366+ )
365367
366368 if model ._keys_to_ignore_on_load_unexpected is not None :
367369 for pat in model ._keys_to_ignore_on_load_unexpected :
0 commit comments