docs: `src/diffusers` readability improvements (#629)
* docs: `src/diffusers` readability improvements Signed-off-by: Ryan Russell <git@ryanrussell.org> * docs: `make style` lint Signed-off-by: Ryan Russell <git@ryanrussell.org> Signed-off-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
parent
1e152030bd
commit
d0aa899f0e
|
@ -436,7 +436,7 @@ class FlaxModelMixin:
|
||||||
)
|
)
|
||||||
cls._missing_keys = missing_keys
|
cls._missing_keys = missing_keys
|
||||||
|
|
||||||
# Mistmatched keys contains tuples key/shape1/shape2 of weights in the checkpoint that have a shape not
|
# Mismatched keys contains tuples key/shape1/shape2 of weights in the checkpoint that have a shape not
|
||||||
# matching the weights in the model.
|
# matching the weights in the model.
|
||||||
mismatched_keys = []
|
mismatched_keys = []
|
||||||
for key in state.keys():
|
for key in state.keys():
|
||||||
|
|
|
@ -244,8 +244,8 @@ class FlaxDiffusionPipeline(ConfigMixin):
|
||||||
|
|
||||||
kwargs (remaining dictionary of keyword arguments, *optional*):
|
kwargs (remaining dictionary of keyword arguments, *optional*):
|
||||||
Can be used to overwrite load - and saveable variables - *i.e.* the pipeline components - of the
|
Can be used to overwrite load - and saveable variables - *i.e.* the pipeline components - of the
|
||||||
specific pipeline class. The overritten components are then directly passed to the pipelines `__init__`
|
specific pipeline class. The overwritten components are then directly passed to the pipelines
|
||||||
method. See example below for more information.
|
`__init__` method. See example below for more information.
|
||||||
|
|
||||||
<Tip>
|
<Tip>
|
||||||
|
|
||||||
|
|
|
@ -235,8 +235,8 @@ class DiffusionPipeline(ConfigMixin):
|
||||||
|
|
||||||
kwargs (remaining dictionary of keyword arguments, *optional*):
|
kwargs (remaining dictionary of keyword arguments, *optional*):
|
||||||
Can be used to overwrite load - and saveable variables - *i.e.* the pipeline components - of the
|
Can be used to overwrite load - and saveable variables - *i.e.* the pipeline components - of the
|
||||||
specific pipeline class. The overritten components are then directly passed to the pipelines `__init__`
|
specific pipeline class. The overwritten components are then directly passed to the pipelines
|
||||||
method. See example below for more information.
|
`__init__` method. See example below for more information.
|
||||||
|
|
||||||
<Tip>
|
<Tip>
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class LDMTextToImagePipeline(DiffusionPipeline):
|
||||||
vqvae ([`VQModel`]):
|
vqvae ([`VQModel`]):
|
||||||
Vector-quantized (VQ) Model to encode and decode images to and from latent representations.
|
Vector-quantized (VQ) Model to encode and decode images to and from latent representations.
|
||||||
bert ([`LDMBertModel`]):
|
bert ([`LDMBertModel`]):
|
||||||
Text-encoder model based on [BERT](ttps://huggingface.co/docs/transformers/model_doc/bert) architecture.
|
Text-encoder model based on [BERT](https://huggingface.co/docs/transformers/model_doc/bert) architecture.
|
||||||
tokenizer (`transformers.BertTokenizer`):
|
tokenizer (`transformers.BertTokenizer`):
|
||||||
Tokenizer of class
|
Tokenizer of class
|
||||||
[BertTokenizer](https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer).
|
[BertTokenizer](https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer).
|
||||||
|
@ -397,7 +397,7 @@ class LDMBertAttention(nn.Module):
|
||||||
attn_output = attn_output.transpose(1, 2)
|
attn_output = attn_output.transpose(1, 2)
|
||||||
|
|
||||||
# Use the `embed_dim` from the config (stored in the class) rather than `hidden_state` because `attn_output` can be
|
# Use the `embed_dim` from the config (stored in the class) rather than `hidden_state` because `attn_output` can be
|
||||||
# partitioned aross GPUs when using tensor-parallelism.
|
# partitioned across GPUs when using tensor-parallelism.
|
||||||
attn_output = attn_output.reshape(bsz, tgt_len, self.inner_dim)
|
attn_output = attn_output.reshape(bsz, tgt_len, self.inner_dim)
|
||||||
|
|
||||||
attn_output = self.out_proj(attn_output)
|
attn_output = self.out_proj(attn_output)
|
||||||
|
|
|
@ -266,7 +266,7 @@ def reset_format() -> None:
|
||||||
|
|
||||||
def warning_advice(self, *args, **kwargs):
|
def warning_advice(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
This method is identical to `logger.warninging()`, but if env var DIFFUSERS_NO_ADVISORY_WARNINGS=1 is set, this
|
This method is identical to `logger.warning()`, but if env var DIFFUSERS_NO_ADVISORY_WARNINGS=1 is set, this
|
||||||
warning will not be printed
|
warning will not be printed
|
||||||
"""
|
"""
|
||||||
no_advisory_warnings = os.getenv("DIFFUSERS_NO_ADVISORY_WARNINGS", False)
|
no_advisory_warnings = os.getenv("DIFFUSERS_NO_ADVISORY_WARNINGS", False)
|
||||||
|
|
Loading…
Reference in New Issue