clip_vision_model¶
Model type |
|
Class |
|
Task |
|
Source |
|
Description¶
CLIP vision model for standalone image feature extraction.
By default this outputs the final last_hidden_state (all encoder layers
followed by post_layernorm).
Two options support multimodal feature extraction used by models such as Phi-3.5-Vision:
feature_layerselects an intermediatehidden_statesindex (HuggingFace convention, e.g.-2). When set, only the encoder layers needed to reach that hidden state are instantiated and run, and the finalpost_layernormis skipped (it is only applied to the last hidden state in HuggingFace).drop_class_tokenremoves the leading CLS token from the output so that only the patch features remain (HuggingFaceimg_feature[:, 1:]).
Usage¶
mobius build --model <MODEL_ID> output_dir/
from mobius import build
model = build("<MODEL_ID>")