Skip to content

Commit 04cd5cc

Browse files
committed
up
1 parent 536df5a commit 04cd5cc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/diffusers/models/modeling_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
from ..quantizers.quantization_config import QuantizationMethod
4242
from ..utils import (
4343
CONFIG_NAME,
44+
ENV_VARS_TRUE_VALUES,
4445
FLAX_WEIGHTS_NAME,
4546
SAFE_WEIGHTS_INDEX_NAME,
4647
SAFETENSORS_WEIGHTS_NAME,
4748
WEIGHTS_INDEX_NAME,
48-
ENV_VARS_TRUE_VALUES,
4949
WEIGHTS_NAME,
5050
_add_variant,
5151
_get_checkpoint_shard_files,
@@ -1547,7 +1547,6 @@ def _load_pretrained_model(
15471547
# load_state_dict will manage the case where we pass a dict instead of a file
15481548
# if state dict is not None, it means that we don't need to read the files from resolved_model_file also
15491549
resolved_model_file = [state_dict]
1550-
is_file = resolved_model_file and state_dict is None
15511550

15521551
# prepare the arguments.
15531552
args_list = [
@@ -1572,7 +1571,7 @@ def _load_pretrained_model(
15721571
for shard_file in resolved_model_file
15731572
]
15741573

1575-
if is_parallel_loading_enabled and is_file:
1574+
if is_parallel_loading_enabled:
15761575
offload_index, state_dict_index, _mismatched_keys, _error_msgs = load_shard_files_with_threadpool(
15771576
args_list
15781577
)

0 commit comments

Comments
 (0)