"...git@developer.sourcefind.cn:OpenDAS/lmdeploy.git" did not exist on "2e5285800ba0d7665c3f7480fdf5d87a29e3670c"
Unverified Commit 4330a747 authored by Dhruv Nair's avatar Dhruv Nair Committed by GitHub
Browse files

[Tests] Fix ControlNet Single File tests (#7315)



* update

* update

---------
Co-authored-by: default avatarSayak Paul <spsayakpaul@gmail.com>
parent 76de6a09
...@@ -1092,6 +1092,13 @@ class ControlNetPipelineSlowTests(unittest.TestCase): ...@@ -1092,6 +1092,13 @@ class ControlNetPipelineSlowTests(unittest.TestCase):
for param_name, param_value in single_file_pipe.controlnet.config.items(): for param_name, param_value in single_file_pipe.controlnet.config.items():
if param_name in PARAMS_TO_IGNORE: if param_name in PARAMS_TO_IGNORE:
continue continue
# This parameter doesn't appear to be loaded from the config.
# So when it is registered to config, it remains a tuple as this is the default in the class definition
# from_pretrained, does load from config and converts to a list when registering to config
if param_name == "conditioning_embedding_out_channels" and isinstance(param_value, tuple):
param_value = list(param_value)
assert ( assert (
pipe.controlnet.config[param_name] == param_value pipe.controlnet.config[param_name] == param_value
), f"{param_name} differs between single file loading and pretrained loading" ), f"{param_name} differs between single file loading and pretrained loading"
......
...@@ -1002,6 +1002,11 @@ class ControlNetSDXLPipelineSlowTests(unittest.TestCase): ...@@ -1002,6 +1002,11 @@ class ControlNetSDXLPipelineSlowTests(unittest.TestCase):
for param_name, param_value in single_file_pipe.unet.config.items(): for param_name, param_value in single_file_pipe.unet.config.items():
if param_name in PARAMS_TO_IGNORE: if param_name in PARAMS_TO_IGNORE:
continue continue
# Upcast attention might be set to None in a config file, which is incorrect. It should default to False in the model
if param_name == "upcast_attention" and pipe.unet.config[param_name] is None:
pipe.unet.config[param_name] = False
assert ( assert (
pipe.unet.config[param_name] == param_value pipe.unet.config[param_name] == param_value
), f"{param_name} differs between single file loading and pretrained loading" ), f"{param_name} differs between single file loading and pretrained loading"
......
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