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

feature: reinforce trust_remote_code=False #979

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

leondz
Copy link
Collaborator

@leondz leondz commented Nov 11, 2024

This change sets trust_remote_code to false regardless of HF function default, unless explicitly enabled in garak config

resolves #991

Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

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

Terrific! Secure by default is definitely a good way to go. One minor expansion since the PegasusT5 class already enforced a value it may be worth "exposing".

Will do some validation testing in the next day to ensure this does not produce regressions in various HFCompatible configurations.

garak/buffs/paraphrase.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

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

Basic sanity testing shows this passing correctly to huggingface pipeline generator instances with the following configuration file.

enable_remote.yaml

plugins:
  generators:
    huggingface:
      hf_args:
        trust_remote_code: true

@jmartin-tech jmartin-tech merged commit e7f8375 into main Nov 12, 2024
9 checks passed
@jmartin-tech jmartin-tech deleted the feature/hf_dont_trust_remote_code branch November 12, 2024 19:17
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Assert trust_remote_code/False for HF models and expose as config var
2 participants