@@ -215,21 +215,14 @@ def test_registered_moderntext_config_builds():
215215 model = open_clip .create_model ('coca2-moderntext-naflex_ViT-B-32' )
216216 assert model .attn_pool_type == 'parallel'
217217 assert model .attn_pool .query .shape == (128 , 512 )
218- # parallel: the contrastive pooler reads (masked) trunk tokens directly, not pooled queries
218+ assert model .attn_pool .attn .k_proj_weight .shape [1 ] == 768 # keys projected from trunk dim
219+ # parallel: the contrastive pooler also reads (masked) trunk tokens, not pooled queries
219220 assert model .attn_pool_contrastive .attn .k_proj_weight .shape [1 ] == 768
221+ assert model .visual .image_seq_len == 64
222+ assert model .visual .trunk .get_patch_size () == (32 , 32 )
223+ assert model .visual .output_tokens
220224 assert model .text .pool .pool_type == 'mean'
221225 assert model .text .cfg .attention_mode == 'causal'
222226 assert (model .pad_id , model .bos_id , model .eos_id ) == (50258 , 50259 , 50257 )
223227 assert model .context_length == 128
224228 assert model .text_decoder .lm_head .weight .shape [0 ] == 50260
225-
226-
227- def test_registered_config_builds ():
228- model = open_clip .create_model ('coca2-naflex_ViT-B-32' )
229- assert model .attn_pool is not None
230- assert model .attn_pool_type == 'cascade'
231- assert model .attn_pool .query .shape == (256 , 512 )
232- assert model .attn_pool .attn .k_proj_weight .shape [1 ] == 768 # keys projected from trunk dim
233- assert model .visual .image_seq_len == 64
234- assert model .visual .trunk .get_patch_size () == (32 , 32 )
235- assert model .visual .output_tokens
0 commit comments