File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
tests/test_methods/method_test_impl/peft Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -177,8 +177,10 @@ def test_get_adapter(self):
177177 n_layers = len (list (model .iter_layers ()))
178178 if model .config .is_encoder_decoder :
179179 n_prefix_layers = 3
180- elif model . config . is_composition or isinstance (model .config , CLIPConfig ):
180+ elif isinstance (model .config , CLIPConfig ):
181181 n_prefix_layers = 2
182+ elif hasattr (model .config , "sub_configs" ) and model .config .sub_configs :
183+ n_prefix_layers = len (model .config .sub_configs )
182184 else :
183185 n_prefix_layers = 1
184186
Original file line number Diff line number Diff line change @@ -30,8 +30,10 @@ def test_get_prefix_tuning(self):
3030 model = self .get_model ()
3131 if model .config .is_encoder_decoder :
3232 n_prefix_layers = 3
33- elif model . config . is_composition or isinstance (model .config , CLIPConfig ):
33+ elif isinstance (model .config , CLIPConfig ):
3434 n_prefix_layers = 2
35+ elif hasattr (model .config , "sub_configs" ) and model .config .sub_configs :
36+ n_prefix_layers = len (model .config .sub_configs )
3537 else :
3638 n_prefix_layers = 1
3739
You can’t perform that action at this time.
0 commit comments