add unsloth/nvidia namespace guard to Nemotron trust_remote_code auto-enable

This commit is contained in:
Roland Tannous 2026-04-06 20:27:15 +00:00
commit 2efca0c43e
2 changed files with 10 additions and 2 deletions

View file

@ -328,7 +328,11 @@ def _handle_load(backend, config: dict, resp_queue: Any) -> None:
trust_remote_code = config.get("trust_remote_code", False)
if not trust_remote_code:
model_name = config["model_name"]
if "nemotron" in model_name.lower():
_mn_lower = model_name.lower()
if (
"nemotron" in _mn_lower
and (_mn_lower.startswith("unsloth/") or _mn_lower.startswith("nvidia/"))
):
trust_remote_code = True
logger.info(
"Auto-enabled trust_remote_code for Nemotron model: %s",

View file

@ -506,7 +506,11 @@ def run_training_process(
# (Qwen3.5, Gemma 4, etc.) are native and do NOT need it — enabling it
# bypasses the compiler (disabling fused CE).
_lowered = model_name.lower()
if "nemotron" in _lowered and not config.get("trust_remote_code", False):
if (
"nemotron" in _lowered
and (_lowered.startswith("unsloth/") or _lowered.startswith("nvidia/"))
and not config.get("trust_remote_code", False)
):
config["trust_remote_code"] = True
logger.info(
"Auto-enabled trust_remote_code for Nemotron model: %s",