| { |
| "architecture": { |
| "attention_variant": "MHA", |
| "family": "zero_shot_image_classification", |
| "is_moe": false, |
| "mixer": "attention", |
| "positional": "learned", |
| "towers": [ |
| { |
| "attention_variant": "MHA", |
| "config_class": "CLIPSegTextConfig", |
| "hidden_size": 512, |
| "name": "text", |
| "num_attention_heads": 8, |
| "num_hidden_layers": 12, |
| "positional": "learned" |
| }, |
| { |
| "attention_variant": "MHA", |
| "config_class": "CLIPSegVisionConfig", |
| "hidden_size": 768, |
| "name": "vision", |
| "num_attention_heads": 12, |
| "num_hidden_layers": 12 |
| } |
| ], |
| "view": "multimodal" |
| }, |
| "capabilities": { |
| "attention_backends": [ |
| "eager", |
| "sdpa", |
| "flash_attention", |
| "flex_attention" |
| ], |
| "attention_patterns": [ |
| "bidirectional" |
| ], |
| "attention_schedule": null, |
| "task_heads": [ |
| "zero_shot_image_classification" |
| ], |
| "tensor_parallel": false |
| }, |
| "components": [ |
| { |
| "children": [ |
| "text_model", |
| "vision_model", |
| "visual_projection", |
| "text_projection" |
| ], |
| "class_name": "CLIPSegModel", |
| "id": "model", |
| "kind": "model", |
| "path_pattern": "model" |
| }, |
| { |
| "children": [ |
| "text_model.embeddings", |
| "text_model.encoder", |
| "text_model.final_layer_norm" |
| ], |
| "class_name": "CLIPSegTextModel", |
| "id": "text_model", |
| "kind": "model", |
| "path_pattern": "model.text_model" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size" |
| }, |
| "children": [ |
| "text_model.embeddings.token_embedding", |
| "text_model.embeddings.position_embedding" |
| ], |
| "class_name": "CLIPSegTextEmbeddings", |
| "id": "text_model.embeddings", |
| "kind": "embedding", |
| "path_pattern": "model.text_model.embeddings" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size" |
| }, |
| "class_name": "Embedding", |
| "id": "text_model.embeddings.token_embedding", |
| "kind": "embedding", |
| "path_pattern": "model.text_model.embeddings.token_embedding" |
| }, |
| { |
| "attributes": { |
| "max_position_embeddings": "config.max_position_embeddings", |
| "scheme": "learned" |
| }, |
| "class_name": "Embedding", |
| "id": "text_model.embeddings.position_embedding", |
| "kind": "position", |
| "path_pattern": "model.text_model.embeddings.position_embedding" |
| }, |
| { |
| "children": [ |
| "encoder_layers" |
| ], |
| "class_name": "CLIPSegEncoder", |
| "id": "text_model.encoder", |
| "kind": "encoder", |
| "path_pattern": "model.text_model.encoder" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "text_model.final_layer_norm", |
| "kind": "normalization", |
| "path_pattern": "model.text_model.final_layer_norm" |
| }, |
| { |
| "children": [ |
| "vision_model.embeddings", |
| "vision_model.pre_layrnorm", |
| "vision_model.encoder", |
| "vision_model.post_layernorm" |
| ], |
| "class_name": "CLIPSegVisionModel", |
| "id": "vision_model", |
| "kind": "model", |
| "path_pattern": "model.vision_model" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size" |
| }, |
| "children": [ |
| "vision_model.embeddings.patch_embedding", |
| "vision_model.embeddings.position_embedding" |
| ], |
| "class_name": "CLIPSegVisionEmbeddings", |
| "id": "vision_model.embeddings", |
| "kind": "embedding", |
| "path_pattern": "model.vision_model.embeddings" |
| }, |
| { |
| "class_name": "Conv2d", |
| "id": "vision_model.embeddings.patch_embedding", |
| "kind": "convolution", |
| "path_pattern": "model.vision_model.embeddings.patch_embedding" |
| }, |
| { |
| "attributes": {}, |
| "class_name": "Embedding", |
| "id": "vision_model.embeddings.position_embedding", |
| "kind": "position", |
| "path_pattern": "model.vision_model.embeddings.position_embedding" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "vision_model.pre_layrnorm", |
| "kind": "normalization", |
| "path_pattern": "model.vision_model.pre_layrnorm" |
| }, |
| { |
| "children": [ |
| "encoder_layer_2s" |
| ], |
| "class_name": "CLIPSegEncoder", |
| "id": "vision_model.encoder", |
| "kind": "encoder", |
| "path_pattern": "model.vision_model.encoder" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "vision_model.post_layernorm", |
| "kind": "normalization", |
| "path_pattern": "model.vision_model.post_layernorm" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": 512 |
| }, |
| "class_name": "Linear", |
| "id": "visual_projection", |
| "kind": "projection", |
| "path_pattern": "model.visual_projection" |
| }, |
| { |
| "attributes": { |
| "in_features": 512, |
| "out_features": 512 |
| }, |
| "class_name": "Linear", |
| "id": "text_projection", |
| "kind": "projection", |
| "path_pattern": "model.text_projection" |
| } |
| ], |
| "config": { |
| "class_name": "CLIPSegConfig", |
| "model_type": "clipseg", |
| "module": "transformers.models.clipseg.configuration_clipseg", |
| "referenced_fields": {}, |
| "salient_fields": { |
| "is_encoder_decoder": false |
| } |
| }, |
| "dataflow": { |
| "input": { |
| "name": "input_ids", |
| "shape": [ |
| "B", |
| "S" |
| ] |
| }, |
| "output": { |
| "shape": [ |
| "B", |
| 1 |
| ] |
| }, |
| "shapes": { |
| "encoder_layer.layer_norm1": { |
| "in": [ |
| "B", |
| "S", |
| 512 |
| ], |
| "out": [ |
| "B", |
| "S", |
| 512 |
| ] |
| }, |
| "encoder_layer.layer_norm2": { |
| "in": [ |
| "B", |
| "S", |
| 512 |
| ], |
| "out": [ |
| "B", |
| "S", |
| 512 |
| ] |
| }, |
| "encoder_layer.mlp": { |
| "in": [ |
| "B", |
| "S", |
| 512 |
| ], |
| "out": [ |
| "B", |
| "S", |
| 512 |
| ] |
| }, |
| "encoder_layer.self_attn": { |
| "in": null, |
| "out": [ |
| "B", |
| "S", |
| 512 |
| ] |
| }, |
| "encoder_layer_2.layer_norm1": { |
| "in": [ |
| "B", |
| 50, |
| 768 |
| ], |
| "out": [ |
| "B", |
| 50, |
| 768 |
| ] |
| }, |
| "encoder_layer_2.layer_norm2": { |
| "in": [ |
| "B", |
| 50, |
| 768 |
| ], |
| "out": [ |
| "B", |
| 50, |
| 768 |
| ] |
| }, |
| "encoder_layer_2.mlp": { |
| "in": [ |
| "B", |
| 50, |
| 768 |
| ], |
| "out": [ |
| "B", |
| 50, |
| 768 |
| ] |
| }, |
| "encoder_layer_2.self_attn": { |
| "in": null, |
| "out": [ |
| "B", |
| 50, |
| 768 |
| ] |
| }, |
| "text_model": { |
| "in": null, |
| "out": [ |
| "B", |
| "S", |
| 512 |
| ] |
| }, |
| "text_projection": { |
| "in": [ |
| "B", |
| 512 |
| ], |
| "out": [ |
| "B", |
| 512 |
| ] |
| }, |
| "vision_model": { |
| "in": null, |
| "out": [ |
| "B", |
| 50, |
| 768 |
| ] |
| }, |
| "visual_projection": { |
| "in": [ |
| "B", |
| 768 |
| ], |
| "out": [ |
| "B", |
| 512 |
| ] |
| } |
| }, |
| "source": "observed_forward_meta" |
| }, |
| "edges": [ |
| { |
| "kind": "data", |
| "source": "text_model", |
| "target": "vision_model" |
| }, |
| { |
| "kind": "data", |
| "source": "text_model.embeddings", |
| "target": "text_model.encoder" |
| }, |
| { |
| "kind": "data", |
| "source": "text_model.encoder", |
| "target": "text_model.final_layer_norm" |
| }, |
| { |
| "kind": "data", |
| "source": "vision_model.embeddings", |
| "target": "vision_model.pre_layrnorm" |
| }, |
| { |
| "kind": "data", |
| "source": "vision_model.pre_layrnorm", |
| "target": "vision_model.encoder" |
| }, |
| { |
| "kind": "data", |
| "source": "vision_model.encoder", |
| "target": "vision_model.post_layernorm" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer_2.self_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.mlp" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer_2", |
| "target": "encoder_layer_2.self_attn" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer_2", |
| "target": "encoder_layer_2.mlp" |
| }, |
| { |
| "kind": "position", |
| "source": "text_model.embeddings.position_embedding", |
| "target": "text_model.embeddings" |
| }, |
| { |
| "kind": "position", |
| "source": "vision_model.embeddings.position_embedding", |
| "target": "vision_model.embeddings" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.self_attn.k_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.self_attn.v_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.self_attn.q_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn.k_proj", |
| "target": "encoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn.v_proj", |
| "target": "encoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.self_attn.q_proj", |
| "target": "encoder_layer.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.mlp", |
| "target": "encoder_layer.mlp.fc1" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.mlp.fc1", |
| "target": "encoder_layer.mlp.fc2" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.self_attn", |
| "target": "encoder_layer_2.self_attn.k_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.self_attn", |
| "target": "encoder_layer_2.self_attn.v_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.self_attn", |
| "target": "encoder_layer_2.self_attn.q_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.self_attn.k_proj", |
| "target": "encoder_layer_2.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.self_attn.v_proj", |
| "target": "encoder_layer_2.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.self_attn.q_proj", |
| "target": "encoder_layer_2.self_attn.out_proj" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.mlp", |
| "target": "encoder_layer_2.mlp.fc1" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer_2.mlp.fc1", |
| "target": "encoder_layer_2.mlp.fc2" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer.layer_norm1", |
| "target": "encoder_layer.self_attn" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer.self_attn", |
| "target": "encoder_layer.layer_norm2" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer.layer_norm2", |
| "target": "encoder_layer.mlp" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer_2.layer_norm1", |
| "target": "encoder_layer_2.self_attn" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer_2.self_attn", |
| "target": "encoder_layer_2.layer_norm2" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "encoder_layer_2.layer_norm2", |
| "target": "encoder_layer_2.mlp" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "vision_model", |
| "target": "visual_projection" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "visual_projection", |
| "target": "text_model" |
| }, |
| { |
| "kind": "data", |
| "provenance": "observed_forward", |
| "source": "text_model", |
| "target": "text_projection" |
| } |
| ], |
| "extends": "clip", |
| "model_type": "clipseg", |
| "patches": [ |
| { |
| "added": { |
| "attrs": [ |
| "projection_dim" |
| ] |
| }, |
| "component_kind": "config", |
| "parent_class": "CLIPTextConfig", |
| "relation": "new", |
| "target_class": "CLIPSegTextConfig" |
| }, |
| { |
| "added": { |
| "attrs": [ |
| "projection_dim" |
| ] |
| }, |
| "component_kind": "config", |
| "parent_class": "CLIPVisionConfig", |
| "relation": "new", |
| "target_class": "CLIPSegVisionConfig" |
| }, |
| { |
| "added": { |
| "attrs": [ |
| "conditional_layer", |
| "decoder_attention_dropout", |
| "decoder_hidden_act", |
| "decoder_intermediate_size", |
| "decoder_num_attention_heads", |
| "extract_layers", |
| "reduce_dim", |
| "use_complex_transposed_convolution" |
| ] |
| }, |
| "component_kind": "config", |
| "parent_class": "CLIPConfig", |
| "relation": "new", |
| "target_class": "CLIPSegConfig" |
| }, |
| { |
| "added": { |
| "attrs": [ |
| "attentions", |
| "hidden_states", |
| "logits" |
| ] |
| }, |
| "component_kind": null, |
| "parent_class": "ModelOutput", |
| "relation": "new", |
| "target_class": "CLIPSegDecoderOutput" |
| }, |
| { |
| "added": { |
| "attrs": [ |
| "conditional_embeddings", |
| "decoder_output", |
| "logits", |
| "loss", |
| "pooled_output", |
| "vision_model_output" |
| ], |
| "methods": [ |
| "to_tuple" |
| ] |
| }, |
| "component_kind": null, |
| "parent_class": "ModelOutput", |
| "relation": "new", |
| "target_class": "CLIPSegImageSegmentationOutput" |
| }, |
| { |
| "component_kind": "embedding", |
| "overridden": { |
| "methods": [ |
| "forward" |
| ] |
| }, |
| "parent_class": "CLIPVisionEmbeddings", |
| "relation": "inherits", |
| "target_class": "CLIPSegVisionEmbeddings" |
| }, |
| { |
| "component_kind": "transformer_block", |
| "overridden": { |
| "methods": [ |
| "forward" |
| ] |
| }, |
| "parent_class": "CLIPEncoderLayer", |
| "relation": "inherits", |
| "target_class": "CLIPSegDecoderLayer" |
| }, |
| { |
| "component_kind": "model", |
| "overridden": { |
| "attrs": [ |
| "_can_record_outputs" |
| ], |
| "methods": [ |
| "_init_weights" |
| ] |
| }, |
| "parent_class": "CLIPPreTrainedModel", |
| "relation": "inherits", |
| "target_class": "CLIPSegPreTrainedModel" |
| }, |
| { |
| "added": { |
| "methods": [ |
| "__init__", |
| "forward" |
| ] |
| }, |
| "component_kind": "decoder", |
| "parent_class": "CLIPSegPreTrainedModel", |
| "relation": "new", |
| "target_class": "CLIPSegDecoder" |
| }, |
| { |
| "component_kind": "model", |
| "overridden": { |
| "methods": [ |
| "forward" |
| ] |
| }, |
| "parent_class": "CLIPTextModel", |
| "relation": "inherits", |
| "target_class": "CLIPSegTextModel" |
| }, |
| { |
| "component_kind": "model", |
| "overridden": { |
| "methods": [ |
| "forward" |
| ] |
| }, |
| "parent_class": "CLIPVisionModel", |
| "relation": "inherits", |
| "target_class": "CLIPSegVisionModel" |
| }, |
| { |
| "component_kind": "model", |
| "overridden": { |
| "methods": [ |
| "forward", |
| "get_image_features", |
| "get_text_features" |
| ] |
| }, |
| "parent_class": "CLIPModel", |
| "relation": "inherits", |
| "target_class": "CLIPSegModel" |
| }, |
| { |
| "added": { |
| "attrs": [ |
| "config" |
| ], |
| "methods": [ |
| "__init__", |
| "forward", |
| "get_conditional_embeddings" |
| ] |
| }, |
| "component_kind": null, |
| "parent_class": "CLIPSegPreTrainedModel", |
| "relation": "new", |
| "target_class": "CLIPSegForImageSegmentation" |
| } |
| ], |
| "provenance": { |
| "config_class": "CLIPSegConfig", |
| "config_module": "transformers.models.clipseg.configuration_clipseg", |
| "model_class": "CLIPSegModel", |
| "model_module": "transformers.models.clipseg.modeling_clipseg" |
| }, |
| "repeats": [ |
| { |
| "body": "encoder_layer", |
| "container_path_pattern": "model.text_model.encoder.layers", |
| "count": 12, |
| "count_expr": "12", |
| "count_source": "module_tree", |
| "id": "encoder_layers", |
| "index_symbol": "i", |
| "item_path_pattern": "model.text_model.encoder.layers.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "CLIPSegEncoderLayer", |
| "container_path_pattern": "model.text_model.encoder.layers", |
| "item_path_pattern": "model.text_model.encoder.layers.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "CLIPSegEncoderLayer" |
| }, |
| { |
| "body": "encoder_layer_2", |
| "container_path_pattern": "model.vision_model.encoder.layers", |
| "count": 12, |
| "count_expr": "12", |
| "count_source": "module_tree", |
| "id": "encoder_layer_2s", |
| "index_symbol": "i", |
| "item_path_pattern": "model.vision_model.encoder.layers.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "CLIPSegEncoderLayer", |
| "container_path_pattern": "model.vision_model.encoder.layers", |
| "item_path_pattern": "model.vision_model.encoder.layers.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "CLIPSegEncoderLayer" |
| } |
| ], |
| "schema_version": "architecture-template-v0", |
| "templates": [ |
| { |
| "children": [ |
| "encoder_layer.self_attn", |
| "encoder_layer.layer_norm1", |
| "encoder_layer.mlp", |
| "encoder_layer.layer_norm2" |
| ], |
| "class_name": "CLIPSegEncoderLayer", |
| "id": "encoder_layer", |
| "kind": "transformer_block", |
| "path_pattern": "model.text_model.encoder.layers.{i}" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 8, |
| "n_kv_heads": 8, |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "encoder_layer.self_attn.k_proj", |
| "encoder_layer.self_attn.v_proj", |
| "encoder_layer.self_attn.q_proj", |
| "encoder_layer.self_attn.out_proj" |
| ], |
| "class_name": "CLIPSegAttention", |
| "id": "encoder_layer.self_attn", |
| "kind": "attention", |
| "path_pattern": "model.text_model.encoder.layers.{i}.self_attn" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.k_proj", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layers.{i}.self_attn.k_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.v_proj", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layers.{i}.self_attn.v_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.q_proj", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layers.{i}.self_attn.q_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.self_attn.out_proj", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layers.{i}.self_attn.out_proj" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer.layer_norm1", |
| "kind": "normalization", |
| "path_pattern": "model.text_model.encoder.layers.{i}.layer_norm1" |
| }, |
| { |
| "attributes": { |
| "activation": "quick_gelu", |
| "hidden_size": 512, |
| "intermediate_size": 2048 |
| }, |
| "children": [ |
| "encoder_layer.mlp.fc1", |
| "encoder_layer.mlp.fc2" |
| ], |
| "class_name": "CLIPSegMLP", |
| "id": "encoder_layer.mlp", |
| "kind": "feed_forward", |
| "path_pattern": "model.text_model.encoder.layers.{i}.mlp" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.intermediate_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.mlp.fc1", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layers.{i}.mlp.fc1" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.intermediate_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.mlp.fc2", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layers.{i}.mlp.fc2" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer.layer_norm2", |
| "kind": "normalization", |
| "path_pattern": "model.text_model.encoder.layers.{i}.layer_norm2" |
| }, |
| { |
| "children": [ |
| "encoder_layer_2.self_attn", |
| "encoder_layer_2.layer_norm1", |
| "encoder_layer_2.mlp", |
| "encoder_layer_2.layer_norm2" |
| ], |
| "class_name": "CLIPSegEncoderLayer", |
| "id": "encoder_layer_2", |
| "kind": "transformer_block", |
| "path_pattern": "model.vision_model.encoder.layers.{i}" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 12, |
| "n_kv_heads": 12, |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "encoder_layer_2.self_attn.k_proj", |
| "encoder_layer_2.self_attn.v_proj", |
| "encoder_layer_2.self_attn.q_proj", |
| "encoder_layer_2.self_attn.out_proj" |
| ], |
| "class_name": "CLIPSegAttention", |
| "id": "encoder_layer_2.self_attn", |
| "kind": "attention", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.self_attn" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer_2.self_attn.k_proj", |
| "kind": "projection", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.self_attn.k_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer_2.self_attn.v_proj", |
| "kind": "projection", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.self_attn.v_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer_2.self_attn.q_proj", |
| "kind": "projection", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.self_attn.q_proj" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer_2.self_attn.out_proj", |
| "kind": "projection", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.self_attn.out_proj" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer_2.layer_norm1", |
| "kind": "normalization", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.layer_norm1" |
| }, |
| { |
| "attributes": { |
| "activation": "quick_gelu", |
| "hidden_size": 768, |
| "intermediate_size": 3072 |
| }, |
| "children": [ |
| "encoder_layer_2.mlp.fc1", |
| "encoder_layer_2.mlp.fc2" |
| ], |
| "class_name": "CLIPSegMLP", |
| "id": "encoder_layer_2.mlp", |
| "kind": "feed_forward", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.mlp" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.intermediate_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer_2.mlp.fc1", |
| "kind": "projection", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.mlp.fc1" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.intermediate_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer_2.mlp.fc2", |
| "kind": "projection", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.mlp.fc2" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer_2.layer_norm2", |
| "kind": "normalization", |
| "path_pattern": "model.vision_model.encoder.layers.{i}.layer_norm2" |
| } |
| ] |
| } |
|
|