CI with num_hidden_layers=2 🚀🚀🚀 (#25266)
* CI with layers=2 --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -78,7 +78,7 @@ class CLIPSegVisionModelTester:
|
||||
num_channels=3,
|
||||
is_training=True,
|
||||
hidden_size=32,
|
||||
num_hidden_layers=5,
|
||||
num_hidden_layers=2,
|
||||
num_attention_heads=4,
|
||||
intermediate_size=37,
|
||||
dropout=0.1,
|
||||
@@ -228,7 +228,7 @@ class CLIPSegTextModelTester:
|
||||
use_labels=True,
|
||||
vocab_size=99,
|
||||
hidden_size=32,
|
||||
num_hidden_layers=5,
|
||||
num_hidden_layers=2,
|
||||
num_attention_heads=4,
|
||||
intermediate_size=37,
|
||||
dropout=0.1,
|
||||
@@ -346,7 +346,15 @@ class CLIPSegTextModelTest(ModelTesterMixin, unittest.TestCase):
|
||||
|
||||
|
||||
class CLIPSegModelTester:
|
||||
def __init__(self, parent, text_kwargs=None, vision_kwargs=None, is_training=True):
|
||||
def __init__(
|
||||
self,
|
||||
parent,
|
||||
text_kwargs=None,
|
||||
vision_kwargs=None,
|
||||
is_training=True,
|
||||
# This should respect the `num_hidden_layers` in `CLIPSegVisionModelTester`
|
||||
extract_layers=(1,),
|
||||
):
|
||||
if text_kwargs is None:
|
||||
text_kwargs = {}
|
||||
if vision_kwargs is None:
|
||||
@@ -356,6 +364,7 @@ class CLIPSegModelTester:
|
||||
self.text_model_tester = CLIPSegTextModelTester(parent, **text_kwargs)
|
||||
self.vision_model_tester = CLIPSegVisionModelTester(parent, **vision_kwargs)
|
||||
self.is_training = is_training
|
||||
self.extract_layers = extract_layers
|
||||
|
||||
def prepare_config_and_inputs(self):
|
||||
text_config, input_ids, attention_mask = self.text_model_tester.prepare_config_and_inputs()
|
||||
@@ -371,7 +380,7 @@ class CLIPSegModelTester:
|
||||
self.vision_model_tester.get_config(),
|
||||
projection_dim=64,
|
||||
reduce_dim=32,
|
||||
extract_layers=[1, 2, 3],
|
||||
extract_layers=self.extract_layers,
|
||||
)
|
||||
|
||||
def create_and_check_model(self, config, input_ids, attention_mask, pixel_values):
|
||||
|
||||
Reference in New Issue
Block a user