Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trust_remote_code Parameter and Set Default to False #5819

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

yafshar
Copy link
Contributor

@yafshar yafshar commented Oct 24, 2024

What does this PR do?

  • Introduced a new model parameter trust_remote_code
  • Set the default value of trust_remote_code to False to enhance security

Before submitting

@yafshar yafshar marked this pull request as ready for review October 24, 2024 23:01
@hiyouga hiyouga added the pending This problem is yet to be addressed label Oct 25, 2024
@hohoCode
Copy link

hohoCode commented Nov 4, 2024

Can we instead set trust_remote_code to True by default? As many more advanced models are getting their own vibes these days. So we have one less thing to worry about? lol.

@yafshar
Copy link
Contributor Author

yafshar commented Nov 4, 2024

@hohoCode it is set to True, by default, but I am suggesting to remove the default behavior.
While setting trust_remote_code to True by default could simplify the process for users, it poses substantial security risks. By allowing remote code execution by default, we open the door to potential vulnerabilities, as users might inadvertently incorporate harmful or unverified code from the web. Which is very common at the moment! It’s safer to keep trust_remote_code set to False by default and encourage users to explicitly enable it only when they are confident about the source and safety of the remote code.

@hiyouga
Copy link
Owner

hiyouga commented Dec 12, 2024

could you rebase this pr? https://github.com/hiyouga/LLaMA-Factory/blob/main/.github/CONTRIBUTING.md

@yafshar
Copy link
Contributor Author

yafshar commented Dec 12, 2024

could you rebase this pr? https://github.com/hiyouga/LLaMA-Factory/blob/main/.github/CONTRIBUTING.md

done!

- Introduced a new model parameter `trust_remote_code`
- Set the default value of `trust_remote_code` to `False`
  to enhance security
@hiyouga hiyouga force-pushed the remote_code branch 2 times, most recently from ecdb2bb to 36f14f9 Compare December 17, 2024 12:32
Copy link
Owner

@hiyouga hiyouga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending This problem is yet to be addressed solved This problem has been already solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants