Skip to content

Commit 5ef288f

Browse files
committed
update logging and comments
1 parent 1d8cf69 commit 5ef288f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/diffusers/loaders/single_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ def from_single_file(cls, pretrained_model_link_or_path, **kwargs):
311311
- A path to a *directory* (for example `./my_pipeline_directory/`) containing the pipeline
312312
component configs in Diffusers format.
313313
no_mmap ('bool', *optional*, defaults to 'False'):
314-
Whether to disable mmap when loading the model. This option can perform better when the model is on
315-
a network mount or hard drive, which may not handle the seeky-ness of mmap very well.
314+
Whether to disable mmap when loading a Safetensors model. This option can perform better when the model
315+
is on a network mount or hard drive, which may not handle the seeky-ness of mmap very well.
316316
kwargs (remaining dictionary of keyword arguments, *optional*):
317317
Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline
318318
class). The overwritten components are passed directly to the pipelines `__init__` method. See example

src/diffusers/loaders/single_file_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
171171
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
172172
allowed by Git.
173173
no_mmap ('bool', *optional*, defaults to 'False'):
174-
Whether to disable mmap when loading the model. This option can perform better when the model is on
175-
a network mount or hard drive, which may not handle the seeky-ness of mmap very well.
174+
Whether to disable mmap when loading a Safetensors model. This option can perform better when the model
175+
is on a network mount or hard drive, which may not handle the seeky-ness of mmap very well.
176176
kwargs (remaining dictionary of keyword arguments, *optional*):
177177
Can be used to overwrite load and saveable variables (for example the pipeline components of the
178178
specific pipeline class). The overwritten components are directly passed to the pipelines `__init__`

src/diffusers/models/model_loading_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ def load_state_dict(checkpoint_file: Union[str, os.PathLike], variant: Optional[
139139
file_extension = os.path.basename(checkpoint_file).split(".")[-1]
140140
if file_extension == SAFETENSORS_FILE_EXTENSION:
141141
if no_mmap:
142-
logger.warning("fast load: " + str(checkpoint_file))
143142
return safetensors.torch.load(open(checkpoint_file, "rb").read())
144143
else:
145-
logger.warning("slow load: " + str(checkpoint_file))
146144
return safetensors.torch.load_file(checkpoint_file, device="cpu")
147145
else:
148146
weights_only_kwarg = {"weights_only": True} if is_torch_version(">=", "1.13") else {}

0 commit comments

Comments
 (0)