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: align hallucinated package named with outputs #1076

Merged
merged 6 commits into from
Feb 18, 2025

Conversation

leondz
Copy link
Collaborator

@leondz leondz commented Jan 15, 2025

Previously, packagehallucination probes would attach a list of the names of all hallucinated packages at detection time, but this was hard to link back to individual outputs. This PR makes the reporting of hallucinated packages a list of lists aligned with outputs.

Example

given an output output: ["import not_a_real_package", "import sys", "pass"]

after running garak.detectors.packagehallucination.PythonPypi() on this,
without PR:
attempt.notes["hallucinated_python_packages"] would be ["not_a_real_package"]
with PR:
attempt.notes["hallucinated_python_packages"] is [["not_a_real_package"], [None], []]

Verification

List the steps needed to make sure this thing works

  • python -m pytest -vvv tests/detectors/test_detectors_packagehallucination.py::test_result_alignment

@leondz leondz added the detectors work on code that inherits from or manages Detector label Jan 15, 2025
@leondz leondz requested a review from jmartin-tech January 15, 2025 09:35
@leondz leondz merged commit 859c413 into NVIDIA:main Feb 18, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2025
@leondz leondz deleted the feature/pkghallu_packagename_alignment branch February 19, 2025 05:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
detectors work on code that inherits from or manages Detector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants