Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
26832aa5
Unverified
Commit
26832aa5
authored
May 09, 2023
by
Steven Liu
Committed by
GitHub
May 09, 2023
Browse files
[docs] Improve safetensors docstring (#3368)
* clarify safetensor docstring * fix typo * apply feedback
parent
c5594795
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
src/diffusers/loaders.py
src/diffusers/loaders.py
+4
-4
src/diffusers/models/modeling_utils.py
src/diffusers/models/modeling_utils.py
+4
-4
src/diffusers/pipelines/pipeline_utils.py
src/diffusers/pipelines/pipeline_utils.py
+4
-4
No files found.
src/diffusers/loaders.py
View file @
26832aa5
...
...
@@ -1221,10 +1221,10 @@ class FromCkptMixin:
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
identifier allowed by git.
use_safetensors (`bool`, *optional*
):
If set to `
Tru
e`, the pipeline will
be
load
ed from
`safetensors` weights
. If set to `None` (
the
default). The pipeline will load using `safetensors` if the safetensors weights are available *and* if
`safetensors`
is installed
. If
the
to `False` the pipeline will *not* use `safetensors`.
use_safetensors (`bool`, *optional*
, defaults to `None`
):
If set to `
Non
e`, the pipeline will load
the
`safetensors` weights
if they're available **and** if
the
`safetensors` library is installed. If set to `True`, the pipeline will forcibly load the models from
`safetensors`
weights
. If
set
to `False` the pipeline will *not* use `safetensors`.
extract_ema (`bool`, *optional*, defaults to `False`): Only relevant for
checkpoints that have both EMA and non-EMA weights. Whether to extract the EMA weights or not. Defaults
to `False`. Pass `True` to extract the EMA weights. EMA weights usually yield higher quality images for
...
...
src/diffusers/models/modeling_utils.py
View file @
26832aa5
...
...
@@ -406,10 +406,10 @@ class ModelMixin(torch.nn.Module):
variant (`str`, *optional*):
If specified load weights from `variant` filename, *e.g.* pytorch_model.<variant>.bin. `variant` is
ignored when using `from_flax`.
use_safetensors (`bool`, *optional*
):
If set to `
Tru
e`, the
pipeline will forcibly load the models from `safetensors` weights. If set to
`
None` (the default). The pipeline will load using `safetensors` if safetensors weights are available
*and* if
`safetensors`
is installed
. If
the
to `False`
the pipel
in
e
will *not* use `safetensors`.
use_safetensors (`bool`, *optional*
, defaults to `None`
):
If set to `
Non
e`, the
`safetensors` weights will be downloaded if they're available **and** if the
`
safetensors` library is installed. If set to `True`, the model will be forcibly loaded from
`safetensors`
weights
. If
set
to `False`
, load
in
g
will *not* use `safetensors`.
<Tip>
...
...
src/diffusers/pipelines/pipeline_utils.py
View file @
26832aa5
...
...
@@ -814,10 +814,10 @@ class DiffusionPipeline(ConfigMixin):
also tries to not use more than 1x model size in CPU memory (including peak memory) while loading the
model. This is only supported when torch version >= 1.9.0. If you are using an older version of torch,
setting this argument to `True` will raise an error.
use_safetensors (`bool`, *optional*
):
If set to `
Tru
e`, the pipeline will
be
load
ed from
`safetensors` weights
. If set to `None` (
the
default). The pipeline will load using `safetensors` if the safetensors weights are available *and* if
`safetensors`
is installed
. If
the
to `False` the pipeline will *not* use `safetensors`.
use_safetensors (`bool`, *optional*
, defaults to `None`
):
If set to `
Non
e`, the pipeline will load
the
`safetensors` weights
if they're available **and** if
the
`safetensors` library is installed. If set to `True`, the pipeline will forcibly load the models from
`safetensors`
weights
. If
set
to `False` the pipeline will *not* use `safetensors`.
kwargs (remaining dictionary of keyword arguments, *optional*):
Can be used to overwrite load - and saveable variables - *i.e.* the pipeline components - of the
specific pipeline class. The overwritten components are then directly passed to the pipelines
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment