From 47f12999fa170fbf458525aea78cfbeeb0990577 Mon Sep 17 00:00:00 2001 From: Jingya HUANG <44135271+JingyaHuang@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:36:19 +0200 Subject: [PATCH] Stable Diffusion quick fix (#162) set default device ids Co-authored-by: Jingya Huang --- optimum/neuron/modeling_diffusion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/optimum/neuron/modeling_diffusion.py b/optimum/neuron/modeling_diffusion.py index d8b7fbfca..86179aab5 100644 --- a/optimum/neuron/modeling_diffusion.py +++ b/optimum/neuron/modeling_diffusion.py @@ -235,7 +235,7 @@ def _from_pretrained( vae_decoder_file_name: Optional[str] = NEURON_FILE_NAME, local_files_only: bool = False, model_save_dir: Optional[Union[str, Path, TemporaryDirectory]] = None, - device_ids: Optional[List[int]] = None, + device_ids: Optional[List[int]] = [], **kwargs, # To share kwargs only available for `_from_transformers` ): model_id = str(model_id) @@ -361,7 +361,7 @@ def _from_transformers( disable_fast_relayout: Optional[bool] = False, disable_fallback: bool = False, dynamic_batch_size: bool = False, - device_ids: Optional[List[int]] = None, + device_ids: Optional[List[int]] = [], **kwargs_shapes, ) -> "NeuronStableDiffusionPipelineBase": if task is None: