File size: 425 Bytes
74b17e0
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from transformers import CLIPVisionModel, CLIPImageProcessor, CLIPVisionConfig

from . import register_vision_tower
from .base import VisionTower


@register_vision_tower('clip')      
class CLIPVisionTower(VisionTower):
    def __init__(self, cfg):
        super().__init__(cfg)
        self._vision_tower = CLIPVisionModel(cfg)
        self._image_processor = CLIPImageProcessor.from_pretrained(cfg.model_name_or_path)