mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
Auto-add timm tag to timm-wrapper models. (#35794)
Works for fine-tuned or exported models:
```py
from transformers import AutoModelForImageClassification
checkpoint = "timm/vit_base_patch16_224.augreg2_in21k_ft_in1k"
model = AutoModelForImageClassification.from_pretrained(checkpoint)
model.push_to_hub("pcuenq/tw1")
```
The uploaded model will now show snippets for both the timm and the
transformers libraries.
This commit is contained in:
parent
dc10f7906a
commit
678bd7f1ce
1 changed files with 1 additions and 0 deletions
|
|
@ -81,6 +81,7 @@ class TimmWrapperPreTrainedModel(PreTrainedModel):
|
|||
main_input_name = "pixel_values"
|
||||
config_class = TimmWrapperConfig
|
||||
_no_split_modules = []
|
||||
model_tags = ["timm"]
|
||||
|
||||
# used in Trainer to avoid passing `loss_kwargs` to model forward
|
||||
accepts_loss_kwargs = False
|
||||
|
|
|
|||
Loading…
Reference in a new issue