-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Hugging Face Language Models Implementation #2350
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev_1.18.0 #2350 +/- ##
==============================================
+ Coverage 73.14% 77.69% +4.55%
==============================================
Files 327 330 +3
Lines 30205 30386 +181
Branches 5589 5634 +45
==============================================
+ Hits 22094 23609 +1515
+ Misses 6807 5429 -1378
- Partials 1304 1348 +44
|
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
Signed-off-by: Farhan Ahmed <[email protected]>
f4str
force-pushed
the
hf-language-models
branch
from
January 18, 2024 23:53
8d7b586
to
38f4429
Compare
Hey @f4str , what's the status on this PR? Shall it be picked up? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implementation of language models under a new
art.estimators.language_modeling
submodule. Currently only Hugging Face language models using a PyTorch back-end have been implemented. This is implemented as theHuggingFaceLanguageModel
which is a generic estimator that is able to run basic functionality on any Hugging Face model.This new language model estimator takes in a Hugging Face model and tokenizer and acts as a basic ART wrapper for now until attacks and defenses for language models are implemented. Currently the estimator only supports the following tasks:
Inference on the estimator will simply return the output dictionary from running inference on the HuggingFace model. The estimator currently does not support training or loss gradients as these are more complex features that will be added later. Once this PR is merged in, additional issues will be created to implement training and loss gradients which will be done as separate PRs.
A demo notebook in
notebooks/hugging_face_language_model.ipynb
was created to illustrate the usage.Fixes #2336
Type of change
Please check all relevant options.
Testing
Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.
HuggingFaceLanguageModel
estimator.Test Configuration:
Checklist