{"record":{"id":"868fbc9ccb8635cc","repo":"huggingface/transformers","slug":"error-message-you-can-inspect-the-repository-con","errorCode":null,"errorMessage":"{error_message} You can inspect the repository content at https://hf.co/{model_name}.\nPlease pass the argument `trust_remote_code=True` to allow custom code to be run.","messagePattern":"(.+?) You can inspect the repository content at https://hf\\.co/(.+?)\\.\nPlease pass the argument `trust_remote_code=True` to allow custom code to be run\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/dynamic_module_utils.py","lineNumber":776,"sourceCode":"        elif has_remote_code and TIME_OUT_REMOTE_CODE > 0:\n            prev_sig_handler = None\n            try:\n                prev_sig_handler = signal.signal(signal.SIGALRM, _raise_timeout_error)\n                signal.alarm(TIME_OUT_REMOTE_CODE)\n                while trust_remote_code is None:\n                    answer = input(\n                        f\"{error_message} You can inspect the repository content at https://hf.co/{model_name}.\\n\"\n                        f\"You can avoid this prompt in future by passing the argument `trust_remote_code=True`.\\n\\n\"\n                        f\"Do you wish to run the custom code? [y/N] \"\n                    )\n                    if answer.lower() in [\"yes\", \"y\", \"1\"]:\n                        trust_remote_code = True\n                    elif answer.lower() in [\"no\", \"n\", \"0\", \"\"]:\n                        trust_remote_code = False\n                signal.alarm(0)\n            except Exception:\n                # OS which does not support signal.SIGALRM\n                raise ValueError(\n                    f\"{error_message} You can inspect the repository content at https://hf.co/{model_name}.\\n\"\n                    f\"Please pass the argument `trust_remote_code=True` to allow custom code to be run.\"\n                )\n            finally:\n                if prev_sig_handler is not None:\n                    signal.signal(signal.SIGALRM, prev_sig_handler)\n                    signal.alarm(0)\n        elif has_remote_code:\n            # For the CI which puts the timeout at 0\n            _raise_timeout_error(None, None)\n\n    if has_remote_code and not has_local_code and not trust_remote_code:\n        raise ValueError(\n            f\"{error_message} You can inspect the repository content at https://hf.co/{model_name}.\\n\"\n            f\"Please pass the argument `trust_remote_code=True` to allow custom code to be run.\"\n        )\n\n    return trust_remote_code","sourceCodeStart":758,"sourceCodeEnd":794,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/dynamic_module_utils.py#L758-L794","documentation":"This ValueError is raised inside the except branch of the trust_remote_code prompt flow: the platform does not support signal.SIGALRM (notably Windows), so the timed interactive prompt cannot be set up at all. Instead of hanging on input(), transformers raises with the standard instruction to pass trust_remote_code explicitly.","triggerScenarios":"Loading a remote-code model without trust_remote_code=True on Windows (or any OS where signal.setitimer/SIGALRM is unavailable) while has_local_code is true, triggering the interactive-confirm branch.","commonSituations":"Windows workstations; some non-POSIX container environments. The same fix applies as the timeout variant: make the trust decision explicitly.","solutions":["Pass trust_remote_code=True (after reviewing the repository code linked in the message).","Or set HF_HUB settings / environment defaults your framework provides for non-interactive trust decisions.","On POSIX systems this branch is not hit; if you see it there, an exception during prompt setup occurred — check for wrapped causes."],"exampleFix":"# before (Windows)\nAutoModel.from_pretrained(\"org/custom-model\")  # ValueError from SIGALRM fallback\n\n# after\nAutoModel.from_pretrained(\"org/custom-model\", trust_remote_code=True)","handlingStrategy":"validation","validationCode":"# On platforms without SIGALRM (Windows), pass the flag explicitly:\nmodel = AutoModel.from_pretrained(repo_id, trust_remote_code=True)","typeGuard":null,"tryCatchPattern":"try:\n    AutoModel.from_pretrained(repo_id)\nexcept ValueError as e:\n    if \"trust_remote_code=True\" in str(e):\n        AutoModel.from_pretrained(repo_id, trust_remote_code=True)\n    else:\n        raise","preventionTips":["Never depend on the interactive prompt on Windows.","Hardcode trust decisions in scripts.","Document which models your pipeline trusts."],"tags":["trust-remote-code","windows","security","platform"],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}