Automatically tag CLIP repos as zero-shot-image-classification (#19064)

* Add CLIP to zero-shot-image-classification

* Make mapping private as it's not used for AutoClassing
This commit is contained in:
Omar Sanseviero
2022-09-16 15:40:38 +02:00
committed by GitHub
parent 820cb97a3f
commit bc5d0b1046
2 changed files with 12 additions and 0 deletions

View File

@@ -771,6 +771,13 @@ MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES = OrderedDict(
]
)
_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMES = OrderedDict(
[
# Model for Zero Shot Image Classification mapping
("clip", "CLIPModel"),
]
)
MODEL_MAPPING = _LazyAutoMapping(CONFIG_MAPPING_NAMES, MODEL_MAPPING_NAMES)
MODEL_FOR_PRETRAINING_MAPPING = _LazyAutoMapping(CONFIG_MAPPING_NAMES, MODEL_FOR_PRETRAINING_MAPPING_NAMES)
MODEL_WITH_LM_HEAD_MAPPING = _LazyAutoMapping(CONFIG_MAPPING_NAMES, MODEL_WITH_LM_HEAD_MAPPING_NAMES)

View File

@@ -91,6 +91,11 @@ PIPELINE_TAGS_AND_AUTO_MODELS = [
"AutoModelForVisualQuestionAnswering",
),
("image-to-text", "MODEL_FOR_FOR_VISION_2_SEQ_MAPPING_NAMES", "AutoModelForVision2Seq"),
(
"zero-shot-image-classification",
"_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMES",
"AutoModel",
),
]