Skip to content

Commit

Permalink
update model parts to use frozen dict
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Sep 10, 2024
1 parent fdac134 commit 5023cac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions optimum/onnxruntime/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
StableDiffusionXLImg2ImgPipeline,
StableDiffusionXLPipeline,
)
from diffusers.configuration_utils import FrozenDict
from diffusers.image_processor import VaeImageProcessor
from diffusers.schedulers.scheduling_utils import SCHEDULER_CONFIG_NAME
from diffusers.utils import CONFIG_NAME, is_invisible_watermark_available
from huggingface_hub import snapshot_download
Expand All @@ -58,7 +60,6 @@
from ..pipelines.diffusers.pipeline_stable_diffusion_inpaint import StableDiffusionInpaintPipelineMixin
from ..pipelines.diffusers.pipeline_stable_diffusion_xl import StableDiffusionXLPipelineMixin
from ..pipelines.diffusers.pipeline_stable_diffusion_xl_img2img import StableDiffusionXLImg2ImgPipelineMixin
from ..pipelines.diffusers.pipeline_utils import VaeImageProcessor
from ..utils import (
DIFFUSION_MODEL_TEXT_ENCODER_2_SUBFOLDER,
DIFFUSION_MODEL_TEXT_ENCODER_SUBFOLDER,
Expand Down Expand Up @@ -503,10 +504,9 @@ def __init__(self, session: ort.InferenceSession, parent_model: ORTPipeline):
config_path = Path(session._model_path).parent / self.CONFIG_NAME

if config_path.is_file():
# TODO: use FrozenDict
self.config = parent_model._dict_from_json_file(config_path)
self.config = FrozenDict(parent_model._dict_from_json_file(config_path))
else:
self.config = {}
self.config = FrozenDict({})

super().__init__(session, parent_model)

Expand Down

0 comments on commit 5023cac

Please sign in to comment.