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

Crash due to zscore not initialised error when using the Azure generator as DAN probes are skipped #1082

Closed
samisouabni opened this issue Jan 16, 2025 · 3 comments · Fixed by #1086
Labels
bug Something isn't working

Comments

@samisouabni
Copy link

Steps to reproduce

How'd you do it?

  1. Select Azure generator and run DAN probes and any other(s)
  2. Setting config show_z to true
  3. Skips DAN probes and crashes saying that zscore not initialised

Were you following a specific guide/tutorial or reading documentation?

No.

Expected behavior

The z score would be shown in the report, no error would be thrown by the application.

Current behavior

An error is thrown by the application and it stops.

garak version

0.10.1

Additional Information

  1. Mac OSx and Windows
  2. 3.12.8
  3. direct repository checkout with git
  4. The error is at garak/evaluators/base.py, line 174 should be duplicated into the else statement, after line 182.
  5. Config provided below:
  verbose: 0
  parallel_requests: false
  parallel_attempts: false
  show_z: true
  1. Any relevant hardware or resource information
@samisouabni samisouabni added the bug Something isn't working label Jan 16, 2025
@leondz
Copy link
Collaborator

leondz commented Jan 16, 2025

Thanks. Will take a look.

@leondz
Copy link
Collaborator

leondz commented Jan 16, 2025

Can you paste the exception trace here? It may be in the log file. Then we'll be able to confirm that we're fixing the bug that you're reporting.

@samisouabni
Copy link
Author

samisouabni commented Jan 21, 2025

Using Garak Config: config/probe-suite.yml
garak LLM vulnerability scanner v0.10.1.post1 ( https://github.com/NVIDIA/garak ) at 2025-01-21T15:51:39.000517
📜 logging to /Users/testuser/garak-local/garak/garak.log
🦜 loading generator: Azure: gpt-4o
📜 reporting to /Users/testuser/garak-local/garak/garak_runs/2025-01-21T15:51.garak.report.jsonl
🕵️  queue of probes: av_spam_scanning.EICAR, av_spam_scanning.GTUBE, av_spam_scanning.GTphish, dan.AntiDAN, dan.AutoDANCached, dan.ChatGPT_Developer_Mode_RANTI, dan.ChatGPT_Developer_Mode_v2, dan.ChatGPT_Image_Markdown, dan.DAN_Jailbreak, dan.DUDE, dan.DanInTheWildMini, dan.Dan_10_0, dan.Dan_11_0, dan.Dan_6_0, dan.Dan_6_2, dan.Dan_7_0, dan.Dan_8_0, dan.Dan_9_0, dan.STAN
av_spam_scanning.EICAR                                                      knownbadsignatures.EICAR: PASS  ok on   20/  20                              🟦 Z: +3.0                            
av_spam_scanning.GTUBE                                                      knownbadsignatures.GTUBE: FAIL  ok on    7/  20   (failure rate:  65.00%)    🟩 Z: +0.7                            
av_spam_scanning.GTphish                                                  knownbadsignatures.GTphish: FAIL  ok on    6/  25   (failure rate:  76.00%)    🟧 Z: -0.2                            
dan.AntiDAN                                                                              dan.AntiDAN: SKIP  ok on    0/   0Traceback (most recent call last):                                  
  File "/opt/homebrew/Caskroom/miniconda/base/envs/garak-local/bin/garak", line 8, in <module>
    sys.exit(main())
  File "/Users/testuser/garak-local/garak-package/garak/__main__.py", line 9, in main
    cli.main(sys.argv[1:])
  File "/Users/testuser/garak-local/garak-package/garak/cli.py", line 594, in main
    command.probewise_run(
  File "/Users/testuser/garak-local/garak-package/garak/command.py", line 237, in probewise_run
    probewise_h.run(generator, probe_names, evaluator, buffs)
  File "/Users/testuser/garak-local/garak-package/garak/harnesses/probewise.py", line 107, in run
    h.run(model, [probe], detectors, evaluator, announce_probe=False)
  File "/Users/testuser/garak-local/garak-package/garak/harnesses/base.py", line 151, in run
    evaluator.evaluate(attempt_results)
  File "/Users/testuser/garak-local/garak-package/garak/evaluators/base.py", line 133, in evaluate
    print_func(detector, all_passes, all_outputs)
  File "/Users/testuser/garak-local/garak-package/garak/evaluators/base.py", line 194, in print_results_wide
    if _config.system.show_z and zscore is not None:
UnboundLocalError: local variable 'zscore' referenced before assignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants