Skip to content

Commit e25e525

Browse files
authored
[LoRA test suite] refactor the test suite and cleanse it (huggingface#7316)
* cleanse and refactor lora testing suite. * more cleanup. * make check_if_lora_correctly_set a utility function * fix: typo * retrigger ci * style
1 parent de9adb9 commit e25e525

35 files changed

+2399
-2353
lines changed

.github/workflows/pr_test_peft_backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ jobs:
105105
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
106106
-s -v \
107107
--make-reports=tests_${{ matrix.config.report }} \
108-
tests/lora/test_lora_layers_peft.py
108+
tests/lora/

examples/community/imagic_stable_diffusion.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
2-
modeled after the textual_inversion.py / train_dreambooth.py and the work
3-
of justinpinkney here: https://github.com/justinpinkney/stable-diffusion/blob/main/notebooks/imagic.ipynb
2+
modeled after the textual_inversion.py / train_dreambooth.py and the work
3+
of justinpinkney here: https://github.com/justinpinkney/stable-diffusion/blob/main/notebooks/imagic.ipynb
44
"""
5+
56
import inspect
67
import warnings
78
from typing import List, Optional, Union

examples/community/seed_resize_stable_diffusion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
2-
modified based on diffusion library from Huggingface: https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
2+
modified based on diffusion library from Huggingface: https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
33
"""
4+
45
import inspect
56
from typing import Callable, List, Optional, Union
67

examples/community/unclip_text_interpolation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def slerp(val, low, high):
3535

3636

3737
class UnCLIPTextInterpolationPipeline(DiffusionPipeline):
38-
3938
"""
4039
Pipeline for prompt-to-prompt interpolation on CLIP text embeddings and using the UnCLIP / Dall-E to decode them to images.
4140

examples/research_projects/multi_token_textual_inversion/multi_token_clip.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
6. Integrate to training x
2424
7. Test
2525
"""
26+
2627
import copy
2728
import random
2829

examples/research_projects/promptdiffusion/convert_original_promptdiffusion_to_diffusers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
""" Conversion script for stable diffusion checkpoints which _only_ contain a controlnet. """
15+
"""Conversion script for stable diffusion checkpoints which _only_ contain a controlnet."""
1616

1717
import argparse
1818
import re

scripts/change_naming_configs_and_checkpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
""" Conversion script for the LDM checkpoints. """
15+
"""Conversion script for the LDM checkpoints."""
1616

1717
import argparse
1818
import json

scripts/convert_i2vgen_to_diffusers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
""" Conversion script for the LDM checkpoints. """
15+
"""Conversion script for the LDM checkpoints."""
1616

1717
import argparse
1818

scripts/convert_ldm_original_checkpoint_to_diffusers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
""" Conversion script for the LDM checkpoints. """
15+
"""Conversion script for the LDM checkpoints."""
1616

1717
import argparse
1818
import json

scripts/convert_lora_safetensor_to_diffusers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
""" Conversion script for the LoRA's safetensors checkpoints. """
16+
"""Conversion script for the LoRA's safetensors checkpoints."""
1717

1818
import argparse
1919

0 commit comments

Comments
 (0)