File size: 577 Bytes
d9c19b7
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import os
from .oryx_vit import OryxViTWrapper

def build_vision_tower(vision_tower_cfg, **kwargs):
    vision_tower = getattr(vision_tower_cfg, 'vision_tower', getattr(vision_tower_cfg, 'mm_vision_tower', None))
    is_absolute_path_exists = os.path.exists(vision_tower)
    if "oryx_vit" in vision_tower:
        print(f"Buiding OryxViTWrapper from {vision_tower}...")
        path = vision_tower.split(":")[1]
        return OryxViTWrapper(vision_tower, path=path, args=vision_tower_cfg, **kwargs)
    else:
        raise ValueError(f'Unknown vision tower: {vision_tower}')