Skip to content

Commit f4977ab

Browse files
authored
Fix typos (#7181)
* Fix typos * Fix typos * Fix typos and update documentation in lora.md
1 parent df8559a commit f4977ab

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

docs/source/en/training/lora.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ accelerate config default
7777

7878
Or if your environment doesn't support an interactive shell, like a notebook, you can use:
7979

80-
```bash
80+
```py
8181
from accelerate.utils import write_basic_config
8282

8383
write_basic_config()
@@ -170,7 +170,7 @@ Aside from setting up the LoRA layers, the training script is more or less the s
170170

171171
Once you've made all your changes or you're okay with the default configuration, you're ready to launch the training script! 🚀
172172

173-
Let's train on the [Pokémon BLIP captions](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions) dataset to generate our yown Pokémon. Set the environment variables `MODEL_NAME` and `DATASET_NAME` to the model and dataset respectively. You should also specify where to save the model in `OUTPUT_DIR`, and the name of the model to save to on the Hub with `HUB_MODEL_ID`. The script creates and saves the following files to your repository:
173+
Let's train on the [Pokémon BLIP captions](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions) dataset to generate our own Pokémon. Set the environment variables `MODEL_NAME` and `DATASET_NAME` to the model and dataset respectively. You should also specify where to save the model in `OUTPUT_DIR`, and the name of the model to save to on the Hub with `HUB_MODEL_ID`. The script creates and saves the following files to your repository:
174174

175175
- saved model checkpoints
176176
- `pytorch_lora_weights.safetensors` (the trained LoRA weights)

docs/source/en/using-diffusers/freeu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ seed = 2023
128128
# The values come from
129129
# https://github.com/lyn-rgb/FreeU_Diffusers#video-pipelines
130130
pipe.enable_freeu(b1=1.2, b2=1.4, s1=0.9, s2=0.2)
131-
video_frames = pipe(prompt, height=320, width=576, num_frames=30, generator=torch.manual_seed(seed)).frames
131+
video_frames = pipe(prompt, height=320, width=576, num_frames=30, generator=torch.manual_seed(seed)).frames[0]
132132
export_to_video(video_frames, "astronaut_rides_horse.mp4")
133133
```
134134

examples/community/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ This example produces the following images:
750750
![image](https://user-images.githubusercontent.com/4313860/198328706-295824a4-9856-4ce5-8e66-278ceb42fd29.png)
751751

752752
### GlueGen Stable Diffusion Pipeline
753-
GlueGen is a minimal adapter that allow alignment between any encoder (Text Encoder of different language, Multilingual Roberta, AudioClip) and CLIP text encoder used in standard Stable Diffusion model. This method allows easy language adaptation to available english Stable Diffusion checkpoints without the need of an image captioning dataset as well as long training hours.
753+
GlueGen is a minimal adapter that allow alignment between any encoder (Text Encoder of different language, Multilingual Roberta, AudioClip) and CLIP text encoder used in standard Stable Diffusion model. This method allows easy language adaptation to available english Stable Diffusion checkpoints without the need of an image captioning dataset as well as long training hours.
754754

755755
Make sure you downloaded `gluenet_French_clip_overnorm_over3_noln.ckpt` for French (there are also pre-trained weights for Chinese, Italian, Japanese, Spanish or train your own) at [GlueGen's official repo](https://github.com/salesforce/GlueGen/tree/main)
756756

@@ -782,9 +782,9 @@ if __name__ == "__main__":
782782
).to(device)
783783
pipeline.load_language_adapter("gluenet_French_clip_overnorm_over3_noln.ckpt", num_token=token_max_length, dim=1024, dim_out=768, tensor_norm=tensor_norm)
784784

785-
prompt = "une voiture sur la plage"
785+
prompt = "une voiture sur la plage"
786786

787-
generator = torch.Generator(device=device).manual_seed(42)
787+
generator = torch.Generator(device=device).manual_seed(42)
788788
image = pipeline(prompt, generator=generator).images[0]
789789
image.save("gluegen_output_fr.png")
790790
```
@@ -1755,7 +1755,7 @@ with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16):
17551755
```
17561756

17571757
The following code compares the performance of the original stable diffusion xl pipeline with the ipex-optimized pipeline.
1758-
By using this optimized pipeline, we can get about 1.4-2 times performance boost with BFloat16 on fourth generation of Intel Xeon CPUs,
1758+
By using this optimized pipeline, we can get about 1.4-2 times performance boost with BFloat16 on fourth generation of Intel Xeon CPUs,
17591759
code-named Sapphire Rapids.
17601760

17611761
```python
@@ -1826,7 +1826,7 @@ This approach is using (optional) CoCa model to avoid writing image description.
18261826

18271827
This SDXL pipeline support unlimited length prompt and negative prompt, compatible with A1111 prompt weighted style.
18281828

1829-
You can provide both `prompt` and `prompt_2`. If only one prompt is provided, `prompt_2` will be a copy of the provided `prompt`. Here is a sample code to use this pipeline.
1829+
You can provide both `prompt` and `prompt_2`. If only one prompt is provided, `prompt_2` will be a copy of the provided `prompt`. Here is a sample code to use this pipeline.
18301830

18311831
```python
18321832
from diffusers import DiffusionPipeline
@@ -3397,7 +3397,7 @@ invert_prompt = "A lying cat"
33973397
input_image = "siamese.jpg"
33983398
steps = 50
33993399
3400-
# Provide prompt used for generation. Same if reconstruction
3400+
# Provide prompt used for generation. Same if reconstruction
34013401
prompt = "A lying cat"
34023402
# or different if editing.
34033403
prompt = "A lying dog"
@@ -3493,7 +3493,7 @@ output_frames = pipe(
34933493
mask_end=0.8,
34943494
mask_strength=0.5,
34953495
negative_prompt='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality'
3496-
).frames
3496+
).frames[0]
34973497

34983498
export_to_video(
34993499
output_frames, "/path/to/video.mp4", 5)
@@ -3636,8 +3636,8 @@ image = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0)
36363636
images = pipeline(
36373637
prompt="A photo of a girl wearing a black dress, holding red roses in hand, upper body, behind is the Eiffel Tower",
36383638
image_embeds=image,
3639-
negative_prompt="monochrome, lowres, bad anatomy, worst quality, low quality",
3640-
num_inference_steps=20, num_images_per_prompt=num_images, width=512, height=704,
3639+
negative_prompt="monochrome, lowres, bad anatomy, worst quality, low quality",
3640+
num_inference_steps=20, num_images_per_prompt=num_images, width=512, height=704,
36413641
generator=generator
36423642
).images
36433643

src/diffusers/configuration_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __getattr__(self, name: str) -> Any:
127127
"""The only reason we overwrite `getattr` here is to gracefully deprecate accessing
128128
config attributes directly. See https://github.com/huggingface/diffusers/pull/3129
129129
130-
Tihs funtion is mostly copied from PyTorch's __getattr__ overwrite:
130+
This function is mostly copied from PyTorch's __getattr__ overwrite:
131131
https://pytorch.org/docs/stable/_modules/torch/nn/modules/module.html#Module
132132
"""
133133

@@ -533,7 +533,7 @@ def extract_init_dict(cls, config_dict, **kwargs):
533533
f"{cls.config_name} configuration file."
534534
)
535535

536-
# 5. Give nice info if config attributes are initiliazed to default because they have not been passed
536+
# 5. Give nice info if config attributes are initialized to default because they have not been passed
537537
passed_keys = set(init_dict.keys())
538538
if len(expected_keys - passed_keys) > 0:
539539
logger.info(

src/diffusers/image_processor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def resize(
332332
image: Union[PIL.Image.Image, np.ndarray, torch.Tensor],
333333
height: int,
334334
width: int,
335-
resize_mode: str = "default", # "defalt", "fill", "crop"
335+
resize_mode: str = "default", # "default", "fill", "crop"
336336
) -> Union[PIL.Image.Image, np.ndarray, torch.Tensor]:
337337
"""
338338
Resize image.
@@ -448,7 +448,7 @@ def preprocess(
448448
image: PipelineImageInput,
449449
height: Optional[int] = None,
450450
width: Optional[int] = None,
451-
resize_mode: str = "default", # "defalt", "fill", "crop"
451+
resize_mode: str = "default", # "default", "fill", "crop"
452452
crops_coords: Optional[Tuple[int, int, int, int]] = None,
453453
) -> torch.Tensor:
454454
"""
@@ -479,7 +479,7 @@ def preprocess(
479479
if isinstance(image, torch.Tensor):
480480
# if image is a pytorch tensor could have 2 possible shapes:
481481
# 1. batch x height x width: we should insert the channel dimension at position 1
482-
# 2. channnel x height x width: we should insert batch dimension at position 0,
482+
# 2. channel x height x width: we should insert batch dimension at position 0,
483483
# however, since both channel and batch dimension has same size 1, it is same to insert at position 1
484484
# for simplicity, we insert a dimension of size 1 at position 1 for both cases
485485
image = image.unsqueeze(1)

src/diffusers/pipelines/auto_pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def from_pipe(cls, pipeline, **kwargs):
343343
pipeline linked to the pipeline class using pattern matching on pipeline class name.
344344
345345
All the modules the pipeline contains will be used to initialize the new pipeline without reallocating
346-
additional memoery.
346+
additional memory.
347347
348348
The pipeline is set in evaluation mode (`model.eval()`) by default.
349349
@@ -616,7 +616,7 @@ def from_pipe(cls, pipeline, **kwargs):
616616
image-to-image pipeline linked to the pipeline class using pattern matching on pipeline class name.
617617
618618
All the modules the pipeline contains will be used to initialize the new pipeline without reallocating
619-
additional memoery.
619+
additional memory.
620620
621621
The pipeline is set in evaluation mode (`model.eval()`) by default.
622622
@@ -892,7 +892,7 @@ def from_pipe(cls, pipeline, **kwargs):
892892
pipeline linked to the pipeline class using pattern matching on pipeline class name.
893893
894894
All the modules the pipeline class contain will be used to initialize the new pipeline without reallocating
895-
additional memoery.
895+
additional memory.
896896
897897
The pipeline is set in evaluation mode (`model.eval()`) by default.
898898

src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
>>> pipe.enable_model_cpu_offload()
5353
5454
>>> prompt = "Spiderman is surfing"
55-
>>> video_frames = pipe(prompt).frames
55+
>>> video_frames = pipe(prompt).frames[0]
5656
>>> video_path = export_to_video(video_frames)
5757
>>> video_path
5858
```

src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_synth_img2img.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
>>> pipe.to("cuda")
5353
5454
>>> prompt = "spiderman running in the desert"
55-
>>> video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=24).frames
55+
>>> video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=24).frames[0]
5656
>>> # safe low-res video
5757
>>> video_path = export_to_video(video_frames, output_video_path="./video_576_spiderman.mp4")
5858
@@ -73,7 +73,7 @@
7373
>>> video = [Image.fromarray(frame).resize((1024, 576)) for frame in video_frames]
7474
7575
>>> # and denoise it
76-
>>> video_frames = pipe(prompt, video=video, strength=0.6).frames
76+
>>> video_frames = pipe(prompt, video=video, strength=0.6).frames[0]
7777
>>> video_path = export_to_video(video_frames, output_video_path="./video_1024_spiderman.mp4")
7878
>>> video_path
7979
```

0 commit comments

Comments
 (0)