feat: add model#load_model method#3780
Merged
aarnphm merged 6 commits intobentoml:mainfrom Apr 21, 2023
Merged
Conversation
sauyon
reviewed
Apr 20, 2023
Codecov Report
@@ Coverage Diff @@
## main #3780 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 154 154
Lines 12613 12619 +6
=====================================
- Misses 12613 12619 +6
|
Co-authored-by: Sauyon Lee <2347889+sauyon@users.noreply.github.com>
aarnphm
previously approved these changes
Apr 20, 2023
aarnphm
reviewed
Apr 20, 2023
aarnphm
previously approved these changes
Apr 20, 2023
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
Contributor
|
@parano I added a quick tests for testing this behaviour in transformers tests. You can run it with |
aarnphm
previously approved these changes
Apr 21, 2023
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
aarnphm
approved these changes
Apr 21, 2023
aarnphm
approved these changes
Apr 21, 2023
model#load_model method
This file contains hidden or 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
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.
What does this PR address?
A slightly nicer way for loading model instances without thinking about which module to use - which is common when building custom runners or testing saved models. Here's an example of usage without vs. with this method added:
Let's say we saved a CLIP model from the transformer:
Without this method, loading the model and processor looks like this:
After this PR:
Fixes #(issue)
Before submitting:
guide on how to create a pull request.
make formatandmake lintscript have passed (instructions)?those accordingly? Here are documentation guidelines and tips on writting docs.