Skip to content

Commit 849a350

Browse files
authored
Change trust_remote_code default to False for security reason (#787)
## What does this PR do? **Type of change:** ? <!-- Use one of the following: Bug fix, new feature, new example, new tests, documentation. --> Bug fix **Overview:** ? Change `trust_remote_code` default to `False` for security reason ## Usage <!-- You can potentially add a usage example below. --> ```python # Add a code snippet demonstrating how to use this ``` ## Testing <!-- Mention how have you tested your change if applicable. --> ## Before your PR is "*Ready for review*" <!-- If you haven't finished some of the above items you can still open `Draft` PR. --> - **Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md)** and your commits are signed. - **Is this change backward compatible?**: Yes/No <!--- If No, explain why. --> - **Did you write any new necessary tests?**: Yes/No - **Did you add or update any necessary documentation?**: Yes/No - **Did you update [Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?**: Yes/No <!--- Only for new features, API changes, critical bug fixes or bw breaking changes. --> ## Additional Information <!-- E.g. related issue. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Updated model loader security settings: remote code is no longer trusted by default when loading model configurations. Users requiring remote code execution must now explicitly enable this option. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
1 parent 0f05d67 commit 849a350

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

modelopt/torch/export/plugins/megatron_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(
7575
workspace_dir: str | None = None,
7676
dtype=torch.bfloat16,
7777
dequantize: bool = True,
78-
trust_remote_code: bool = True,
78+
trust_remote_code: bool = False,
7979
verbose: bool = False,
8080
moe_router_dtype: torch.dtype | None = None,
8181
):

0 commit comments

Comments
 (0)