Skip to content

Commit a4f7080

Browse files
committed
update
1 parent 67dc65e commit a4f7080

File tree

4 files changed

+33
-30
lines changed

4 files changed

+33
-30
lines changed

tests/pipelines/audioldm2/test_audioldm2.py

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
import pytest
2222
import torch
2323
from transformers import (
24-
ClapAudioConfig,
2524
ClapConfig,
2625
ClapFeatureExtractor,
2726
ClapModel,
28-
ClapTextConfig,
2927
GPT2Config,
3028
GPT2LMHeadModel,
3129
RobertaTokenizer,
@@ -111,33 +109,33 @@ def get_dummy_components(self):
111109
latent_channels=4,
112110
)
113111
torch.manual_seed(0)
114-
text_branch_config = ClapTextConfig(
115-
bos_token_id=0,
116-
eos_token_id=2,
117-
hidden_size=8,
118-
intermediate_size=37,
119-
layer_norm_eps=1e-05,
120-
num_attention_heads=1,
121-
num_hidden_layers=1,
122-
pad_token_id=1,
123-
vocab_size=1000,
124-
projection_dim=8,
125-
)
126-
audio_branch_config = ClapAudioConfig(
127-
spec_size=8,
128-
window_size=4,
129-
num_mel_bins=8,
130-
intermediate_size=37,
131-
layer_norm_eps=1e-05,
132-
depths=[1, 1],
133-
num_attention_heads=[1, 1],
134-
num_hidden_layers=1,
135-
hidden_size=192,
136-
projection_dim=8,
137-
patch_size=2,
138-
patch_stride=2,
139-
patch_embed_input_channels=4,
140-
)
112+
text_branch_config = {
113+
"bos_token_id": 0,
114+
"eos_token_id": 2,
115+
"hidden_size": 8,
116+
"intermediate_size": 37,
117+
"layer_norm_eps": 1e-05,
118+
"num_attention_heads": 1,
119+
"num_hidden_layers": 1,
120+
"pad_token_id": 1,
121+
"vocab_size": 1000,
122+
"projection_dim": 8,
123+
}
124+
audio_branch_config = {
125+
"spec_size": 8,
126+
"window_size": 4,
127+
"num_mel_bins": 8,
128+
"intermediate_size": 37,
129+
"layer_norm_eps": 1e-05,
130+
"depths": [1, 1],
131+
"num_attention_heads": [1, 1],
132+
"num_hidden_layers": 1,
133+
"hidden_size": 192,
134+
"projection_dim": 8,
135+
"patch_size": 2,
136+
"patch_stride": 2,
137+
"patch_embed_input_channels": 4,
138+
}
141139
text_encoder_config = ClapConfig(
142140
text_config=text_branch_config, audio_config=audio_branch_config, projection_dim=16
143141
)

tests/pipelines/kandinsky2_2/test_kandinsky_combined.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
KandinskyV22InpaintCombinedPipeline,
2424
)
2525

26-
from ...testing_utils import enable_full_determinism, require_torch_accelerator, torch_device
26+
from ...testing_utils import enable_full_determinism, require_accelerator, require_torch_accelerator, torch_device
2727
from ..test_pipelines_common import PipelineTesterMixin
2828
from .test_kandinsky import Dummies
2929
from .test_kandinsky_img2img import Dummies as Img2ImgDummies
@@ -402,6 +402,7 @@ def test_save_load_local(self):
402402
def test_save_load_optional_components(self):
403403
super().test_save_load_optional_components(expected_max_difference=5e-4)
404404

405+
@require_accelerator
405406
def test_sequential_cpu_offload_forward_pass(self):
406407
super().test_sequential_cpu_offload_forward_pass(expected_max_diff=5e-4)
407408

tests/pipelines/kandinsky2_2/test_kandinsky_inpaint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
load_image,
3838
load_numpy,
3939
numpy_cosine_similarity_distance,
40+
require_accelerator,
4041
require_torch_accelerator,
4142
slow,
4243
torch_device,
@@ -254,6 +255,7 @@ def test_model_cpu_offload_forward_pass(self):
254255
def test_save_load_optional_components(self):
255256
super().test_save_load_optional_components(expected_max_difference=5e-4)
256257

258+
@require_accelerator
257259
def test_sequential_cpu_offload_forward_pass(self):
258260
super().test_sequential_cpu_offload_forward_pass(expected_max_diff=5e-4)
259261

tests/pipelines/stable_diffusion_2/test_stable_diffusion_latent_upscale.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
floats_tensor,
3838
load_image,
3939
load_numpy,
40+
require_accelerator,
4041
require_torch_accelerator,
4142
slow,
4243
torch_device,
@@ -222,6 +223,7 @@ def test_stable_diffusion_latent_upscaler_multiple_init_images(self):
222223
def test_attention_slicing_forward_pass(self):
223224
super().test_attention_slicing_forward_pass(expected_max_diff=7e-3)
224225

226+
@require_accelerator
225227
def test_sequential_cpu_offload_forward_pass(self):
226228
super().test_sequential_cpu_offload_forward_pass(expected_max_diff=3e-3)
227229

0 commit comments

Comments
 (0)