1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-29 07:22:12 +03:00
This commit is contained in:
DN6
2025-08-18 13:29:07 +05:30
parent 0db2ea2bc8
commit 4b2b2b221b

View File

@@ -170,13 +170,13 @@ def resolve_trust_remote_code(trust_remote_code, model_name, has_remote_code):
trust_remote_code = trust_remote_code and not DIFFUSERS_DISABLE_REMOTE_CODE
if DIFFUSERS_DISABLE_REMOTE_CODE:
logger.warning(
"Remote code execution has been disabled globally via DIFFUSERS_DISABLE_REMOTE_CODE environment variable. Ignoring `trust_remote_code`."
"Downloading remote code is disabled globally via the DIFFUSERS_DISABLE_REMOTE_CODE environment variable. Ignoring `trust_remote_code`."
)
if has_remote_code and not trust_remote_code:
error_msg = f"The repository for {model_name} contains custom code. "
error_msg += (
"Remote code is disabled globally via DIFFUSERS_DISABLE_REMOTE_CODE."
"Downloading remote code is disabled globally via the DIFFUSERS_DISABLE_REMOTE_CODE environment variable."
if DIFFUSERS_DISABLE_REMOTE_CODE
else "Pass `trust_remote_code=True` to allow loading remote code modules."
)