"src/libtorchaudio/pybind/pybind.cpp" did not exist on "33dc817c60b957e9c929ed6071d4d21fd00e4845"
Unverified Commit e25e525f authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[LoRA test suite] refactor the test suite and cleanse it (#7316)

* cleanse and refactor lora testing suite.

* more cleanup.

* make check_if_lora_correctly_set a utility function

* fix: typo

* retrigger ci

* style
parent de9adb90
...@@ -105,4 +105,4 @@ jobs: ...@@ -105,4 +105,4 @@ jobs:
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-s -v \ -s -v \
--make-reports=tests_${{ matrix.config.report }} \ --make-reports=tests_${{ matrix.config.report }} \
tests/lora/test_lora_layers_peft.py tests/lora/
""" """
modeled after the textual_inversion.py / train_dreambooth.py and the work modeled after the textual_inversion.py / train_dreambooth.py and the work
of justinpinkney here: https://github.com/justinpinkney/stable-diffusion/blob/main/notebooks/imagic.ipynb of justinpinkney here: https://github.com/justinpinkney/stable-diffusion/blob/main/notebooks/imagic.ipynb
""" """
import inspect import inspect
import warnings import warnings
from typing import List, Optional, Union from typing import List, Optional, Union
......
""" """
modified based on diffusion library from Huggingface: https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py modified based on diffusion library from Huggingface: https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
""" """
import inspect import inspect
from typing import Callable, List, Optional, Union from typing import Callable, List, Optional, Union
......
...@@ -35,7 +35,6 @@ def slerp(val, low, high): ...@@ -35,7 +35,6 @@ def slerp(val, low, high):
class UnCLIPTextInterpolationPipeline(DiffusionPipeline): class UnCLIPTextInterpolationPipeline(DiffusionPipeline):
""" """
Pipeline for prompt-to-prompt interpolation on CLIP text embeddings and using the UnCLIP / Dall-E to decode them to images. Pipeline for prompt-to-prompt interpolation on CLIP text embeddings and using the UnCLIP / Dall-E to decode them to images.
......
...@@ -23,6 +23,7 @@ TODO: ...@@ -23,6 +23,7 @@ TODO:
6. Integrate to training x 6. Integrate to training x
7. Test 7. Test
""" """
import copy import copy
import random import random
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for stable diffusion checkpoints which _only_ contain a controlnet. """ """Conversion script for stable diffusion checkpoints which _only_ contain a controlnet."""
import argparse import argparse
import re import re
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the LDM checkpoints. """ """Conversion script for the LDM checkpoints."""
import argparse import argparse
import json import json
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the LDM checkpoints. """ """Conversion script for the LDM checkpoints."""
import argparse import argparse
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the LDM checkpoints. """ """Conversion script for the LDM checkpoints."""
import argparse import argparse
import json import json
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the LoRA's safetensors checkpoints. """ """Conversion script for the LoRA's safetensors checkpoints."""
import argparse import argparse
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the LDM checkpoints. """ """Conversion script for the LDM checkpoints."""
import argparse import argparse
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the NCSNPP checkpoints. """ """Conversion script for the NCSNPP checkpoints."""
import argparse import argparse
import json import json
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the AudioLDM2 checkpoints.""" """Conversion script for the AudioLDM2 checkpoints."""
import argparse import argparse
import re import re
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the AudioLDM checkpoints.""" """Conversion script for the AudioLDM checkpoints."""
import argparse import argparse
import re import re
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for stable diffusion checkpoints which _only_ contain a controlnet. """ """Conversion script for stable diffusion checkpoints which _only_ contain a controlnet."""
import argparse import argparse
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the MusicLDM checkpoints.""" """Conversion script for the MusicLDM checkpoints."""
import argparse import argparse
import re import re
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the LDM checkpoints. """ """Conversion script for the LDM checkpoints."""
import argparse import argparse
import importlib import importlib
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Conversion script for the Versatile Stable Diffusion checkpoints. """ """Conversion script for the Versatile Stable Diffusion checkpoints."""
import argparse import argparse
from argparse import Namespace from argparse import Namespace
......
...@@ -11,6 +11,7 @@ $ python convert_zero123_to_diffusers.py \ ...@@ -11,6 +11,7 @@ $ python convert_zero123_to_diffusers.py \
--original_config_file /path/zero123/configs/sd-objaverse-finetune-c_concat-256.yaml --original_config_file /path/zero123/configs/sd-objaverse-finetune-c_concat-256.yaml
``` ```
""" """
import argparse import argparse
import torch import torch
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" ConfigMixin base class and utilities.""" """ConfigMixin base class and utilities."""
import dataclasses import dataclasses
import functools import functools
import importlib import importlib
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment