Skip to content

Commit

Permalink
Fix diffusion caching (#594)
Browse files Browse the repository at this point in the history
fixes #593

Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com>
Co-authored-by: Raphael Glon <oOraph@users.noreply.github.com>
  • Loading branch information
oOraph and oOraph authored May 14, 2024
1 parent 7e21931 commit 7dd2341
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion optimum/neuron/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
"""NeuroStableDiffusionPipeline class for inference of diffusion models on neuron devices."""

import copy
import importlib
import logging
import os
Expand Down Expand Up @@ -698,6 +699,7 @@ def _export(
save_dir = TemporaryDirectory()
save_dir_path = Path(save_dir.name)
# 1. Fetch all model configs
input_shapes_copy = copy.deepcopy(input_shapes)
models_and_neuron_configs, _ = load_models_and_neuron_configs(
model_name_or_path=model_id,
output=save_dir_path,
Expand All @@ -717,7 +719,7 @@ def _export(
lora_weight_names=lora_weight_names,
lora_adapter_names=lora_adapter_names,
lora_scales=lora_scales,
**input_shapes,
**input_shapes_copy,
)

# 2. Build compilation config
Expand Down

0 comments on commit 7dd2341

Please sign in to comment.