"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "e185084a5df12f6cf23ba455828808a3d8e3fda6"
Unverified Commit ed8fd383 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

Improve deprecation warnings (#3131)

parent ca783a0f
...@@ -201,24 +201,24 @@ def variant_compatible_siblings(filenames, variant=None) -> Union[List[os.PathLi ...@@ -201,24 +201,24 @@ def variant_compatible_siblings(filenames, variant=None) -> Union[List[os.PathLi
# .bin, .safetensors, ... # .bin, .safetensors, ...
weight_suffixs = [w.split(".")[-1] for w in weight_names] weight_suffixs = [w.split(".")[-1] for w in weight_names]
# -00001-of-00002 # -00001-of-00002
transformers_index_format = "\d{5}-of-\d{5}" transformers_index_format = r"\d{5}-of-\d{5}"
if variant is not None: if variant is not None:
# `diffusion_pytorch_model.fp16.bin` as well as `model.fp16-00001-of-00002.safetenstors` # `diffusion_pytorch_model.fp16.bin` as well as `model.fp16-00001-of-00002.safetenstors`
variant_file_re = re.compile( variant_file_re = re.compile(
f"({'|'.join(weight_prefixes)})\.({variant}|{variant}-{transformers_index_format})\.({'|'.join(weight_suffixs)})$" rf"({'|'.join(weight_prefixes)})\.({variant}|{variant}-{transformers_index_format})\.({'|'.join(weight_suffixs)})$"
) )
# `text_encoder/pytorch_model.bin.index.fp16.json` # `text_encoder/pytorch_model.bin.index.fp16.json`
variant_index_re = re.compile( variant_index_re = re.compile(
f"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.{variant}\.json$" rf"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.{variant}\.json$"
) )
# `diffusion_pytorch_model.bin` as well as `model-00001-of-00002.safetenstors` # `diffusion_pytorch_model.bin` as well as `model-00001-of-00002.safetenstors`
non_variant_file_re = re.compile( non_variant_file_re = re.compile(
f"({'|'.join(weight_prefixes)})(-{transformers_index_format})?\.({'|'.join(weight_suffixs)})$" rf"({'|'.join(weight_prefixes)})(-{transformers_index_format})?\.({'|'.join(weight_suffixs)})$"
) )
# `text_encoder/pytorch_model.bin.index.json` # `text_encoder/pytorch_model.bin.index.json`
non_variant_index_re = re.compile(f"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.json") non_variant_index_re = re.compile(rf"({'|'.join(weight_prefixes)})\.({'|'.join(weight_suffixs)})\.index\.json")
if variant is not None: if variant is not None:
variant_weights = {f for f in filenames if variant_file_re.match(f.split("/")[-1]) is not None} variant_weights = {f for f in filenames if variant_file_re.match(f.split("/")[-1]) is not None}
......
...@@ -71,6 +71,7 @@ class LoraLoaderMixinTests(unittest.TestCase): ...@@ -71,6 +71,7 @@ class LoraLoaderMixinTests(unittest.TestCase):
beta_schedule="scaled_linear", beta_schedule="scaled_linear",
clip_sample=False, clip_sample=False,
set_alpha_to_one=False, set_alpha_to_one=False,
steps_offset=1,
) )
torch.manual_seed(0) torch.manual_seed(0)
vae = AutoencoderKL( vae = AutoencoderKL(
......
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