correct model config path
Browse files- vision_tower_builder.py +2 -1
vision_tower_builder.py
CHANGED
@@ -10,6 +10,7 @@ import torch
|
|
10 |
import torch.nn as nn
|
11 |
import torch.nn.functional as F
|
12 |
from einops import rearrange, repeat
|
|
|
13 |
|
14 |
from functools import partial
|
15 |
from typing import Optional, Tuple, Union
|
@@ -704,7 +705,7 @@ def build_vision_tower(
|
|
704 |
if isinstance(device, str):
|
705 |
device = torch.device(device)
|
706 |
|
707 |
-
model_cfg = json.load(open(
|
708 |
if 'rope' in model_cfg.get('vision_cfg', {}):
|
709 |
if model_cfg['vision_cfg']['rope']:
|
710 |
os.environ['RoPE'] = "1"
|
|
|
10 |
import torch.nn as nn
|
11 |
import torch.nn.functional as F
|
12 |
from einops import rearrange, repeat
|
13 |
+
from pathlib import Path
|
14 |
|
15 |
from functools import partial
|
16 |
from typing import Optional, Tuple, Union
|
|
|
705 |
if isinstance(device, str):
|
706 |
device = torch.device(device)
|
707 |
|
708 |
+
model_cfg = json.load(open(Path(__file__).parent / f'{model_name}.json'))
|
709 |
if 'rope' in model_cfg.get('vision_cfg', {}):
|
710 |
if model_cfg['vision_cfg']['rope']:
|
711 |
os.environ['RoPE'] = "1"
|