File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 7
7
from lightllm .models .vit .layer_weights .pre_and_post_layer_weight import ViTPreAndPostLayerWeight
8
8
from lightllm .models .vit .layer_weights .transformer_layer_weight import ViTTransformerLayerWeight
9
9
from lightllm .models .vit .layer_weights .hf_load_utils import load_hf_weights
10
+ from lightllm .common .build_utils import repair_config
10
11
from lightllm .utils .log_utils import init_logger
11
12
from lightllm .models .vit import get_load_image_func
12
13
import torchvision .transforms as T
@@ -59,6 +60,9 @@ def _init_config(self):
59
60
self .config ["vision_config" ]["llm_hidden_size" ] = self .config ["llm_config" ]["hidden_size" ]
60
61
self .config ["vision_config" ]["downsample_ratio" ] = self .config ["downsample_ratio" ]
61
62
self .config = self .config ["vision_config" ]
63
+ repair_config (self .config , same_names = ["num_attention_heads" , "n_head" ])
64
+ repair_config (self .config , same_names = ["hidden_size" , "n_embd" , "n_embed" ])
65
+ repair_config (self .config , same_names = ["num_hidden_layers" , "n_layer" ])
62
66
self .layers_num = self .config ["num_hidden_layers" ]
63
67
return
64
68
You can’t perform that action at this time.
0 commit comments