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

generator: vision nims #959

Merged
merged 9 commits into from
Oct 29, 2024
Merged

generator: vision nims #959

merged 9 commits into from
Oct 29, 2024

Conversation

leondz
Copy link
Collaborator

@leondz leondz commented Oct 25, 2024

resolves #691

  • New class nim.NIMVision, following the huggingface.LLaVa pattern
  • New interstitial method in NIM.NVOpenAIChat that converts prompts to LLM input
  • Relax a typing constraint in attempt to allow non-string prompts
  • Specific messages for one exception type in OpenAICompatible

Verification

  • garak -m nim.NIMVision -n microsoft/phi-3-vision-128k-instruct -p visual_jailbreak.FigStep -g 1 --parallel_attempts 16
  • Verify the thing does not do what it should not
  • Document check the class doc in nim.NIMVision

Questions:

Copy link
Collaborator

@erickgalinkin erickgalinkin left a comment

Choose a reason for hiding this comment

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

LGTM

garak/attempt.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.

Test look good.

arak LLM vulnerability scanner v0.9.0.16.post1 ( https://github.com/leondz/garak ) at 2024-10-28T16:17:57.248817
📜 logging to /home/jemartin/.local/share/garak/garak.log
🦜 loading generator: NIM: microsoft/phi-3-vision-128k-instruct
📜 reporting to /home/jemartin/.local/share/garak/garak_runs/garak.ba3fbd2c-70fd-459f-b938-890b14609e6c.report.jsonl
🕵️  queue of probes: visual_jailbreak.FigStep
visual_jailbreak.FigStep                                                    visual_jailbreak.FigStep: FAIL  ok on   65/  70   (failure rate:   7.14%)
📜 report closed :) /home/jemartin/.local/share/garak/garak_runs/garak.ba3fbd2c-70fd-459f-b938-890b14609e6c.report.jsonl
📜 report html summary being written to /home/jemartin/.local/share/garak/garak_runs/garak.ba3fbd2c-70fd-459f-b938-890b14609e6c.report.html
✔️  garak run complete in 135.21s
garak LLM vulnerability scanner v0.9.0.16.post1 ( https://github.com/leondz/garak ) at 2024-10-28T16:22:59.141907
📜 logging to /home/jemartin/.local/share/garak/garak.log
🦜 loading generator: NIM: microsoft/phi-3-vision-128k-instruct
📜 reporting to /home/jemartin/.local/share/garak/garak_runs/garak.df5ba817-adcb-4660-9c6b-e5507e601dab.report.jsonl
🕵️  queue of probes: encoding.InjectBase64
encoding.InjectBase64                                                           encoding.DecodeMatch: PASS  ok on   55/  55
📜 report closed :) /home/jemartin/.local/share/garak/garak_runs/garak.df5ba817-adcb-4660-9c6b-e5507e601dab.report.jsonl
📜 report html summary being written to /home/jemartin/.local/share/garak/garak_runs/garak.df5ba817-adcb-4660-9c6b-e5507e601dab.report.html
✔️  garak run complete in 7.94s

garak/attempt.py Outdated Show resolved Hide resolved
Comment on lines +32 to +34
DEFAULT_PARAMS = {
"strict_modality_match": False,
}
Copy link
Collaborator

@jmartin-tech jmartin-tech Oct 28, 2024

Choose a reason for hiding this comment

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

This seems reasonable to be in the harness for now, however I see some possible contention as noted in the description questions.

I suspect strict modality matching requirements may lean toward being a responsibility of the probe to define requirements. I suspect the technique employed in the probe will set the requirement for strict match as generators may often support various modalities.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interested to hear more

@jmartin-tech jmartin-tech merged commit 0a9bbea into main Oct 29, 2024
9 checks passed
@jmartin-tech jmartin-tech deleted the generator/vision_nim branch October 29, 2024 19:07
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 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.

generator: multimodal nim
3 participants