Skip to content

Commit 536df5a

Browse files
committed
up
1 parent ab84d5a commit 536df5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/models/modeling_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
SAFE_WEIGHTS_INDEX_NAME,
4646
SAFETENSORS_WEIGHTS_NAME,
4747
WEIGHTS_INDEX_NAME,
48+
ENV_VARS_TRUE_VALUES,
4849
WEIGHTS_NAME,
4950
_add_variant,
5051
_get_checkpoint_shard_files,
@@ -959,8 +960,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
959960
dduf_entries: Optional[Dict[str, DDUFEntry]] = kwargs.pop("dduf_entries", None)
960961
disable_mmap = kwargs.pop("disable_mmap", False)
961962

962-
# TODO: enable TRUE ENV VARs
963-
is_parallel_loading_enabled = bool(os.environ.get("HF_ENABLE_PARALLEL_LOADING", 0))
963+
is_parallel_loading_enabled = os.environ.get("HF_ENABLE_PARALLEL_LOADING", "").upper() in ENV_VARS_TRUE_VALUES
964964

965965
if is_parallel_loading_enabled and not low_cpu_mem_usage:
966966
raise NotImplementedError("Parallel loading is not supported when not using `low_cpu_mem_usage`.")

0 commit comments

Comments
 (0)