from transformers import AutoModel, AutoImageProcessor from . import register_vision_tower from .base import VisionTower @register_vision_tower('aimv2') class AIMv2Tower(VisionTower): def __init__(self, cfg): super().__init__(cfg) self._vision_tower = AutoModel.from_pretrained(cfg.model_name_or_path, config = cfg, trust_remote_code=True) self._image_processor = AutoImageProcessor.from_pretrained(cfg.model_name_or_path)