-
Notifications
You must be signed in to change notification settings - Fork 45
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/implement the fuzz tests in robustness #1190
Feature/implement the fuzz tests in robustness #1190
Conversation
…sks; implement AttackerLLM for adversarial learning in exam questions
…sage handling and reasoning prompt generation
…s; add MedFuzzSample for improved data handling
…d improved response handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements fuzz tests for robustness by introducing the MedFuzz feature. Key changes include:
- Refactoring CSV loading in utils.py to download remote files.
- Creating new LLM interaction classes (TargetLLM, AttackerLLM) and a MedFuzz class in clinical.py for processing clinical samples.
- Extending sample data types with HTML highlighting to display differences for MedFuzz samples.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
langtest/transform/utils.py | Refactored load_csv to download files; added TargetLLM and AttackerLLM classes. |
langtest/transform/clinical.py | Introduced MedFuzz class and integrated LLM interactions for fuzz testing. |
langtest/utils/custom_types/helpers.py | Added highlight_differences_both function for generating HTML diff highlights. |
langtest/utils/custom_types/sample.py | Added MedFuzzSample subclass that overrides to_dict to incorporate HTML diff highlighting. |
Comments suppressed due to low confidence (3)
langtest/transform/utils.py:574
- The new CSV downloading mechanism uses requests.get on the 'filepath' variable assuming it is a URL. Consider validating the input or adding error handling to ensure that non-URL file paths are managed appropriately.
# save the csv file into `~/.langtest/` directory
langtest/transform/utils.py:1052
- The error message here is unclear. Consider rephrasing it to clearly indicate the unsupported configuration in the LLM client.
raise TypeError("Unsupported hub and model and Only LLM")
langtest/transform/clinical.py:981
- Slicing the joined expected_results with [:1] might unintentionally truncate the value. Verify that this behavior is intended, or adjust to preserve the full expected result as needed.
med_sample.expected_results = "".join(map(str, med_sample.expected_results))[:1]
…andling in MedFuzz transformation
…for original and perturbed data
Harness Setup: