Skip to content

Commit ed8fd38

Browse files
Improve deprecation warnings (#3131)
1 parent ca783a0 commit ed8fd38

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,24 +201,24 @@ def variant_compatible_siblings(filenames, variant=None) -> Union[List[os.PathLi
201201
# .bin, .safetensors, ...
202202
weight_suffixs = [w.split(".")[-1] for w in weight_names]
203203
# -00001-of-00002
204-
transformers_index_format = "\d{5}-of-\d{5}"
204+
transformers_index_format = r"\d{5}-of-\d{5}"
205205

206206
if variant is not None:
207207
# `diffusion_pytorch_model.fp16.bin` as well as `model.fp16-00001-of-00002.safetenstors`
208208
variant_file_re = re.compile(
209-
f"({'|'.join(weight_prefixes)})\.({variant}|{variant}-{transformers_index_format})\.({'|'.join(weight_suffixs)})$"
209+
rf"({'|'.join(weight_prefixes)})\.({variant}|{variant}-{transformers_index_format})\.({'|'.join(weight_suffixs)})$"
210210
)
211211
# `text_encoder/pytorch_model.bin.index.fp16.json`
212212
variant_index_re = re.compile(
213-
f"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.{variant}\.json$"
213+
rf"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.{variant}\.json$"
214214
)
215215

216216
# `diffusion_pytorch_model.bin` as well as `model-00001-of-00002.safetenstors`
217217
non_variant_file_re = re.compile(
218-
f"({'|'.join(weight_prefixes)})(-{transformers_index_format})?\.({'|'.join(weight_suffixs)})$"
218+
rf"({'|'.join(weight_prefixes)})(-{transformers_index_format})?\.({'|'.join(weight_suffixs)})$"
219219
)
220220
# `text_encoder/pytorch_model.bin.index.json`
221-
non_variant_index_re = re.compile(f"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.json")
221+
non_variant_index_re = re.compile(rf"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.json")
222222

223223
if variant is not None:
224224
variant_weights = {f for f in filenames if variant_file_re.match(f.split("/")[-1]) is not None}

tests/models/test_lora_layers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def get_dummy_components(self):
7171
beta_schedule="scaled_linear",
7272
clip_sample=False,
7373
set_alpha_to_one=False,
74+
steps_offset=1,
7475
)
7576
torch.manual_seed(0)
7677
vae = AutoencoderKL(

0 commit comments

Comments
 (0)