[Tests] add requires peft decorator. (#11037)
* add requires peft decorator. * install peft conditionally. * conditional deps. Co-authored-by: DN6 <dhruv.nair@gmail.com> --------- Co-authored-by: DN6 <dhruv.nair@gmail.com>
This commit is contained in:
@@ -414,12 +414,16 @@ jobs:
|
|||||||
config:
|
config:
|
||||||
- backend: "bitsandbytes"
|
- backend: "bitsandbytes"
|
||||||
test_location: "bnb"
|
test_location: "bnb"
|
||||||
|
additional_deps: ["peft"]
|
||||||
- backend: "gguf"
|
- backend: "gguf"
|
||||||
test_location: "gguf"
|
test_location: "gguf"
|
||||||
|
additional_deps: []
|
||||||
- backend: "torchao"
|
- backend: "torchao"
|
||||||
test_location: "torchao"
|
test_location: "torchao"
|
||||||
|
additional_deps: []
|
||||||
- backend: "optimum_quanto"
|
- backend: "optimum_quanto"
|
||||||
test_location: "quanto"
|
test_location: "quanto"
|
||||||
|
additional_deps: []
|
||||||
runs-on:
|
runs-on:
|
||||||
group: aws-g6e-xlarge-plus
|
group: aws-g6e-xlarge-plus
|
||||||
container:
|
container:
|
||||||
@@ -437,6 +441,9 @@ jobs:
|
|||||||
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
|
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
|
||||||
python -m uv pip install -e [quality,test]
|
python -m uv pip install -e [quality,test]
|
||||||
python -m uv pip install -U ${{ matrix.config.backend }}
|
python -m uv pip install -U ${{ matrix.config.backend }}
|
||||||
|
if [ "${{ join(matrix.config.additional_deps, ' ') }}" != "" ]; then
|
||||||
|
python -m uv pip install ${{ join(matrix.config.additional_deps, ' ') }}
|
||||||
|
fi
|
||||||
python -m uv pip install pytest-reportlog
|
python -m uv pip install pytest-reportlog
|
||||||
- name: Environment
|
- name: Environment
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ from diffusers.utils.testing_utils import (
|
|||||||
numpy_cosine_similarity_distance,
|
numpy_cosine_similarity_distance,
|
||||||
require_accelerate,
|
require_accelerate,
|
||||||
require_bitsandbytes_version_greater,
|
require_bitsandbytes_version_greater,
|
||||||
|
require_peft_backend,
|
||||||
require_torch,
|
require_torch,
|
||||||
require_torch_gpu,
|
require_torch_gpu,
|
||||||
require_transformers_version_greater,
|
require_transformers_version_greater,
|
||||||
@@ -668,6 +669,7 @@ class SlowBnb4BitFluxTests(Base4bitTests):
|
|||||||
max_diff = numpy_cosine_similarity_distance(expected_slice, out_slice)
|
max_diff = numpy_cosine_similarity_distance(expected_slice, out_slice)
|
||||||
self.assertTrue(max_diff < 1e-3)
|
self.assertTrue(max_diff < 1e-3)
|
||||||
|
|
||||||
|
@require_peft_backend
|
||||||
def test_lora_loading(self):
|
def test_lora_loading(self):
|
||||||
self.pipeline_4bit.load_lora_weights(
|
self.pipeline_4bit.load_lora_weights(
|
||||||
hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), adapter_name="hyper-sd"
|
hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), adapter_name="hyper-sd"
|
||||||
|
|||||||
Reference in New Issue
Block a user