Integrate AutoModelForSequenceClassification through PytorchModel
Description
- This PR adds an initial implementation for the HuggingFace SequenceClassification model with some initial functionality. I also organized imports using isort and made a few adjustments to increase flake8 compliance
This should be taken as an initial step toward: #238, #103, and #217
Implemented changes
- Insert a description of the changes implemented in the pull request.
- [x] Modify the
PyTorchModelprediction method to accept the HuggingFace model - [x] Adds new tests that prove new feature
- [x] Add flake8 parametrization to tox
- [x] Modify some import ordering according to
isort
- [x] Modify the
Minimum acceptance criteria
- Specify what is necessary for the PR to be merged with the main branch.
- @mentions of the person that is apt to review these changes, e.g., @annahedstroem
Codecov Report
Attention: Patch coverage is 95.83333% with 1 lines in your changes are missing coverage. Please review.
Project coverage is 91.20%. Comparing base (
8d88cd7) to head (4afbfec).
| Files | Patch % | Lines |
|---|---|---|
| quantus/helpers/model/pytorch_model.py | 95.83% | 1 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #339 +/- ##
=======================================
Coverage 91.19% 91.20%
=======================================
Files 66 66
Lines 3906 3921 +15
=======================================
+ Hits 3562 3576 +14
- Misses 344 345 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
based on the tesing, it looks like we need to add transformers also to the tests and not only full: https://github.com/understandable-machine-intelligence-lab/Quantus/actions/runs/8328433263/job/22788366589?pr=339