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:
Ryan Russell 2022-09-24 09:21:28 -05:00 committed by GitHub
parent 1e152030bd
commit d0aa899f0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -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():

View File

@ -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>

View File

@ -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>

View File

@ -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)

View File

@ -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)