Skip to content

Commit 2cfdc23

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a91517d commit 2cfdc23

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

auto_round/compressors/diffusion/compressor.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from auto_round.utils import (
3030
LazyImport,
3131
clear_memory,
32+
config_save_pretrained,
3233
copy_python_files_from_model_cache,
3334
diffusion_load_model,
3435
dispatch_model_by_all_available_devices,
@@ -37,8 +38,6 @@
3738
get_block_names,
3839
merge_block_output_keys,
3940
wrap_block_forward_positional_to_kwargs,
40-
dispatch_model_by_all_available_devices,
41-
config_save_pretrained,
4241
)
4342

4443
pipeline_utils = LazyImport("diffusers.pipelines.pipeline_utils")
@@ -519,9 +518,9 @@ def save_quantized(self, output_dir=None, format="auto_round", inplace=True, **k
519518
if not hasattr(self.pipe.config, "save_pretrained"):
520519
# For Z-Image, tuning will cause this attribute missing, we need to add it back before saving config
521520
setattr(
522-
self.pipe.config,
523-
"save_pretrained",
524-
partial(config_save_pretrained, self.pipe.config, "model_index.json")
521+
self.pipe.config,
522+
"save_pretrained",
523+
partial(config_save_pretrained, self.pipe.config, "model_index.json"),
525524
)
526525
self.pipe.config.save_pretrained(output_dir)
527526
return compressed_model

auto_round/utils/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,7 @@ def _nextstep_pipeline_fn(pipe, prompts, guidance_scale=7.5, num_inference_steps
19561956
pipe._autoround_pipeline_fn = _nextstep_pipeline_fn
19571957
return pipe, model
19581958

1959+
19591960
def config_save_pretrained(config, file_name, save_directory):
19601961
if os.path.isfile(save_directory):
19611962
raise AssertionError(f"Provided path ({save_directory}) should be a directory, not a file")

0 commit comments

Comments
 (0)