-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Add TimmBackbone model #22619
Add TimmBackbone model #22619
Conversation
The documentation is not available anymore as the PR was closed or merged. |
37cd88d
to
345672d
Compare
@@ -445,6 +445,7 @@ def job_name(self): | |||
"pip install -e .[dev]", | |||
"pip install git+https://github.com/huggingface/accelerate", | |||
"pip install --upgrade pytest pytest-sugar", | |||
"pip install natten", |
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.
Needed for Dinat and Nat doc tests
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.
Thanks a lot for your PR! Just a couple of nits here and there but it looks great!
|
||
def __init__(self, config, **kwargs): | ||
requires_backends(self, "timm") | ||
import timm |
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.
Might be cleaner to do this at the top of the file under an is_timm_available()
but no strong opinions.
0745535
to
8316f23
Compare
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
@ydshieh Merging now. I'll address any comments or requests for changes in a follow up PR. |
* Add test_backbone for convnext * Add TimmBackbone model * Add check for backbone type * Tidying up - config checks * Update convnextv2 * Tidy up * Fix indices & clearer comment * Exceptions for config checks * Correclty update config for tests * Safer imports * Safer safer imports * Fix where decorators go * Update import logic and backbone tests * More import fixes * Fixup * Only import all_models if torch available * Fix kwarg updates in from_pretrained & main rebase * Tidy up * Add tests for AutoBackbone * Tidy up * Fix import error * Fix up * Install nattan in doc_test_job * Revert back to setting self._out_xxx directly * Bug fix - out_indices mapping from out_features * Fix tests * Dont accept output_loading_info for Timm models * Set out_xxx and don't remap * Use smaller checkpoint for test * Don't remap timm indices - check out_indices based on stage names * Skip test as it's n/a * Apply suggestions from code review Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * Cleaner imports / spelling is hard --------- Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
What does this PR do?
Adds a new model TimmBackbone to use for loading timm weights for use in the AutoBackbone API.
Example usage:
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.