| { |
| "architecture": { |
| "attention_variant": "MHA", |
| "is_moe": false, |
| "mixer": "attention", |
| "positional": "learned", |
| "towers": [ |
| { |
| "attention_variant": "MHA", |
| "config_class": "ClapTextConfig", |
| "hidden_size": 768, |
| "name": "text", |
| "num_attention_heads": 12, |
| "num_hidden_layers": 12, |
| "positional": "learned" |
| }, |
| { |
| "config_class": "ClapAudioConfig", |
| "hidden_size": 768, |
| "name": "audio", |
| "num_attention_heads": [ |
| 4, |
| 8, |
| 16, |
| 32 |
| ], |
| "num_hidden_layers": 4 |
| } |
| ], |
| "view": "multimodal" |
| }, |
| "capabilities": { |
| "attention_backends": [ |
| "eager" |
| ], |
| "attention_patterns": [ |
| "bidirectional" |
| ], |
| "attention_schedule": null, |
| "task_heads": [], |
| "tensor_parallel": false |
| }, |
| "components": [ |
| { |
| "children": [ |
| "text_model", |
| "text_projection", |
| "audio_model", |
| "audio_projection" |
| ], |
| "class_name": "ClapModel", |
| "id": "model", |
| "kind": "model", |
| "path_pattern": "model" |
| }, |
| { |
| "children": [ |
| "text_model.embeddings", |
| "text_model.encoder", |
| "text_model.pooler" |
| ], |
| "class_name": "ClapTextModel", |
| "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.word_embeddings", |
| "text_model.embeddings.token_type_embeddings", |
| "text_model.embeddings.LayerNorm", |
| "text_model.embeddings.position_embeddings" |
| ], |
| "class_name": "ClapTextEmbeddings", |
| "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.word_embeddings", |
| "kind": "embedding", |
| "path_pattern": "model.text_model.embeddings.word_embeddings" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": 1 |
| }, |
| "class_name": "Embedding", |
| "id": "text_model.embeddings.token_type_embeddings", |
| "kind": "embedding", |
| "path_pattern": "model.text_model.embeddings.token_type_embeddings" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "text_model.embeddings.LayerNorm", |
| "kind": "normalization", |
| "path_pattern": "model.text_model.embeddings.LayerNorm" |
| }, |
| { |
| "attributes": { |
| "max_position_embeddings": "config.max_position_embeddings", |
| "scheme": "learned" |
| }, |
| "class_name": "Embedding", |
| "id": "text_model.embeddings.position_embeddings", |
| "kind": "position", |
| "path_pattern": "model.text_model.embeddings.position_embeddings" |
| }, |
| { |
| "children": [ |
| "encoder_layers" |
| ], |
| "class_name": "ClapTextEncoder", |
| "id": "text_model.encoder", |
| "kind": "encoder", |
| "path_pattern": "model.text_model.encoder" |
| }, |
| { |
| "class_name": "ClapTextPooler", |
| "id": "text_model.pooler", |
| "kind": "pooler", |
| "path_pattern": "model.text_model.pooler" |
| }, |
| { |
| "class_name": "ClapProjectionLayer", |
| "id": "text_projection", |
| "kind": "transformer_block", |
| "path_pattern": "model.text_projection" |
| }, |
| { |
| "children": [ |
| "audio_model.audio_encoder" |
| ], |
| "class_name": "ClapAudioModel", |
| "id": "audio_model", |
| "kind": "model", |
| "path_pattern": "model.audio_model" |
| }, |
| { |
| "children": [ |
| "audio_model.audio_encoder.patch_embed", |
| "encoder_layer_2s", |
| "audio_model.audio_encoder.norm" |
| ], |
| "class_name": "ClapAudioEncoder", |
| "id": "audio_model.audio_encoder", |
| "kind": "encoder", |
| "path_pattern": "model.audio_model.audio_encoder" |
| }, |
| { |
| "children": [ |
| "audio_model.audio_encoder.patch_embed.proj", |
| "audio_model.audio_encoder.patch_embed.norm" |
| ], |
| "class_name": "ClapAudioPatchEmbed", |
| "id": "audio_model.audio_encoder.patch_embed", |
| "kind": "module", |
| "path_pattern": "model.audio_model.audio_encoder.patch_embed" |
| }, |
| { |
| "class_name": "Conv2d", |
| "id": "audio_model.audio_encoder.patch_embed.proj", |
| "kind": "convolution", |
| "path_pattern": "model.audio_model.audio_encoder.patch_embed.proj" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "audio_model.audio_encoder.patch_embed.norm", |
| "kind": "normalization", |
| "path_pattern": "model.audio_model.audio_encoder.patch_embed.norm" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "audio_model.audio_encoder.norm", |
| "kind": "normalization", |
| "path_pattern": "model.audio_model.audio_encoder.norm" |
| }, |
| { |
| "class_name": "ClapProjectionLayer", |
| "id": "audio_projection", |
| "kind": "transformer_block", |
| "path_pattern": "model.audio_projection" |
| } |
| ], |
| "config": { |
| "class_name": "ClapConfig", |
| "model_type": "clap", |
| "module": "transformers.models.clap.configuration_clap", |
| "referenced_fields": {}, |
| "salient_fields": { |
| "hidden_size": 768, |
| "is_encoder_decoder": false, |
| "num_hidden_layers": 16 |
| } |
| }, |
| "edges": [ |
| { |
| "kind": "data", |
| "source": "text_model", |
| "target": "text_projection" |
| }, |
| { |
| "kind": "data", |
| "source": "text_projection", |
| "target": "audio_model" |
| }, |
| { |
| "kind": "data", |
| "source": "audio_model", |
| "target": "audio_projection" |
| }, |
| { |
| "kind": "data", |
| "source": "text_model.embeddings", |
| "target": "text_model.encoder" |
| }, |
| { |
| "kind": "data", |
| "source": "text_model.encoder", |
| "target": "text_model.pooler" |
| }, |
| { |
| "kind": "data", |
| "source": "text_model.embeddings.word_embeddings", |
| "target": "text_model.embeddings.token_type_embeddings" |
| }, |
| { |
| "kind": "data", |
| "source": "text_model.embeddings.token_type_embeddings", |
| "target": "text_model.embeddings.LayerNorm" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_layer.attention", |
| "target": "encoder_layer.intermediate" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_layer.intermediate", |
| "target": "encoder_layer.output" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_block.layernorm_before", |
| "target": "encoder_block.attention" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_block.layernorm_after", |
| "target": "encoder_block.intermediate" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_block.intermediate", |
| "target": "encoder_block.output" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer.attention" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer.attention.self" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_block.attention" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_block.attention.self" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.attention" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.intermediate" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_block", |
| "target": "encoder_block.attention" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_block", |
| "target": "encoder_block.intermediate" |
| }, |
| { |
| "kind": "position", |
| "source": "text_model.embeddings.position_embeddings", |
| "target": "text_model.embeddings" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.attention.self", |
| "target": "encoder_layer.attention.self.query" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.attention.self", |
| "target": "encoder_layer.attention.self.key" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.attention.self", |
| "target": "encoder_layer.attention.self.value" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.intermediate", |
| "target": "encoder_layer.intermediate.dense" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.output", |
| "target": "encoder_layer.output.dense" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_block.attention.self", |
| "target": "encoder_block.attention.self.query" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_block.attention.self", |
| "target": "encoder_block.attention.self.key" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_block.attention.self", |
| "target": "encoder_block.attention.self.value" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_block.intermediate", |
| "target": "encoder_block.intermediate.dense" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_block.output", |
| "target": "encoder_block.output.dense" |
| } |
| ], |
| "extends": null, |
| "model_type": "clap", |
| "provenance": { |
| "config_class": "ClapConfig", |
| "config_module": "transformers.models.clap.configuration_clap", |
| "model_class": "ClapModel", |
| "model_module": "transformers.models.clap.modeling_clap" |
| }, |
| "repeats": [ |
| { |
| "body": "encoder_layer", |
| "container_path_pattern": "model.text_model.encoder.layer", |
| "count": 12, |
| "count_expr": "12", |
| "count_source": "module_tree", |
| "id": "encoder_layers", |
| "index_symbol": "i", |
| "item_path_pattern": "model.text_model.encoder.layer.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "ClapTextLayer", |
| "container_path_pattern": "model.text_model.encoder.layer", |
| "item_path_pattern": "model.text_model.encoder.layer.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "ClapTextLayer" |
| }, |
| { |
| "body": "encoder_layer_2", |
| "container_path_pattern": "model.audio_model.audio_encoder.layers", |
| "count": 4, |
| "count_expr": "4", |
| "count_source": "module_tree", |
| "id": "encoder_layer_2s", |
| "index_symbol": "i", |
| "item_path_pattern": "model.audio_model.audio_encoder.layers.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "ClapAudioStage", |
| "container_path_pattern": "model.audio_model.audio_encoder.layers", |
| "item_path_pattern": "model.audio_model.audio_encoder.layers.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "ClapAudioStage" |
| }, |
| { |
| "body": "encoder_block", |
| "container_path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks", |
| "count": 2, |
| "count_expr": "2", |
| "count_source": "module_tree", |
| "id": "encoder_blocks", |
| "index_symbol": "j", |
| "item_path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "ClapAudioLayer", |
| "container_path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks", |
| "item_path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "ClapAudioLayer" |
| } |
| ], |
| "schema_version": "architecture-template-v0", |
| "templates": [ |
| { |
| "children": [ |
| "encoder_layer.attention", |
| "encoder_layer.intermediate", |
| "encoder_layer.output" |
| ], |
| "class_name": "ClapTextLayer", |
| "id": "encoder_layer", |
| "kind": "transformer_block", |
| "path_pattern": "model.text_model.encoder.layer.{i}" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 12, |
| "n_kv_heads": 12, |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "encoder_layer.attention.self", |
| "encoder_layer.attention.output" |
| ], |
| "class_name": "ClapTextAttention", |
| "id": "encoder_layer.attention", |
| "kind": "attention", |
| "path_pattern": "model.text_model.encoder.layer.{i}.attention" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 12, |
| "n_kv_heads": 12, |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "encoder_layer.attention.self.query", |
| "encoder_layer.attention.self.key", |
| "encoder_layer.attention.self.value" |
| ], |
| "class_name": "ClapTextSelfAttention", |
| "id": "encoder_layer.attention.self", |
| "kind": "attention", |
| "path_pattern": "model.text_model.encoder.layer.{i}.attention.self" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.attention.self.query", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layer.{i}.attention.self.query" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.attention.self.key", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layer.{i}.attention.self.key" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.attention.self.value", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layer.{i}.attention.self.value" |
| }, |
| { |
| "children": [ |
| "encoder_layer.attention.output.LayerNorm" |
| ], |
| "class_name": "ClapTextSelfOutput", |
| "id": "encoder_layer.attention.output", |
| "kind": "module", |
| "path_pattern": "model.text_model.encoder.layer.{i}.attention.output" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer.attention.output.LayerNorm", |
| "kind": "normalization", |
| "path_pattern": "model.text_model.encoder.layer.{i}.attention.output.LayerNorm" |
| }, |
| { |
| "attributes": { |
| "activation": "gelu", |
| "hidden_size": 768, |
| "intermediate_size": 3072 |
| }, |
| "children": [ |
| "encoder_layer.intermediate.dense" |
| ], |
| "class_name": "ClapTextIntermediate", |
| "id": "encoder_layer.intermediate", |
| "kind": "feed_forward", |
| "path_pattern": "model.text_model.encoder.layer.{i}.intermediate" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": "config.intermediate_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.intermediate.dense", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layer.{i}.intermediate.dense" |
| }, |
| { |
| "attributes": { |
| "activation": "gelu", |
| "hidden_size": 768, |
| "intermediate_size": 3072 |
| }, |
| "children": [ |
| "encoder_layer.output.dense", |
| "encoder_layer.output.LayerNorm" |
| ], |
| "class_name": "ClapTextOutput", |
| "id": "encoder_layer.output", |
| "kind": "feed_forward", |
| "path_pattern": "model.text_model.encoder.layer.{i}.output" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.intermediate_size", |
| "out_features": "config.hidden_size" |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.output.dense", |
| "kind": "projection", |
| "path_pattern": "model.text_model.encoder.layer.{i}.output.dense" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer.output.LayerNorm", |
| "kind": "normalization", |
| "path_pattern": "model.text_model.encoder.layer.{i}.output.LayerNorm" |
| }, |
| { |
| "children": [ |
| "encoder_blocks", |
| "encoder_layer_2.downsample" |
| ], |
| "class_name": "ClapAudioStage", |
| "id": "encoder_layer_2", |
| "kind": "module", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}" |
| }, |
| { |
| "children": [ |
| "encoder_layer_2.downsample.norm" |
| ], |
| "class_name": "ClapAudioPatchMerging", |
| "id": "encoder_layer_2.downsample", |
| "kind": "module", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.downsample" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_layer_2.downsample.norm", |
| "kind": "normalization", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.downsample.norm" |
| }, |
| { |
| "children": [ |
| "encoder_block.layernorm_before", |
| "encoder_block.attention", |
| "encoder_block.layernorm_after", |
| "encoder_block.intermediate", |
| "encoder_block.output" |
| ], |
| "class_name": "ClapAudioLayer", |
| "id": "encoder_block", |
| "kind": "transformer_block", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_block.layernorm_before", |
| "kind": "normalization", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.layernorm_before" |
| }, |
| { |
| "attributes": { |
| "rope": false |
| }, |
| "children": [ |
| "encoder_block.attention.self" |
| ], |
| "class_name": "ClapAudioAttention", |
| "id": "encoder_block.attention", |
| "kind": "attention", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.attention" |
| }, |
| { |
| "attributes": { |
| "rope": false |
| }, |
| "children": [ |
| "encoder_block.attention.self.query", |
| "encoder_block.attention.self.key", |
| "encoder_block.attention.self.value" |
| ], |
| "class_name": "ClapAudioSelfAttention", |
| "id": "encoder_block.attention.self", |
| "kind": "attention", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.attention.self" |
| }, |
| { |
| "attributes": { |
| "in_features": 96, |
| "out_features": 96 |
| }, |
| "class_name": "Linear", |
| "id": "encoder_block.attention.self.query", |
| "kind": "projection", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.attention.self.query" |
| }, |
| { |
| "attributes": { |
| "in_features": 96, |
| "out_features": 96 |
| }, |
| "class_name": "Linear", |
| "id": "encoder_block.attention.self.key", |
| "kind": "projection", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.attention.self.key" |
| }, |
| { |
| "attributes": { |
| "in_features": 96, |
| "out_features": 96 |
| }, |
| "class_name": "Linear", |
| "id": "encoder_block.attention.self.value", |
| "kind": "projection", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.attention.self.value" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "LayerNorm", |
| "id": "encoder_block.layernorm_after", |
| "kind": "normalization", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.layernorm_after" |
| }, |
| { |
| "attributes": { |
| "activation": "gelu", |
| "hidden_size": 768 |
| }, |
| "children": [ |
| "encoder_block.intermediate.dense" |
| ], |
| "class_name": "ClapAudioIntermediate", |
| "id": "encoder_block.intermediate", |
| "kind": "feed_forward", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.intermediate" |
| }, |
| { |
| "attributes": { |
| "in_features": 96, |
| "out_features": 384 |
| }, |
| "class_name": "Linear", |
| "id": "encoder_block.intermediate.dense", |
| "kind": "projection", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.intermediate.dense" |
| }, |
| { |
| "attributes": { |
| "activation": "gelu", |
| "hidden_size": 768 |
| }, |
| "children": [ |
| "encoder_block.output.dense" |
| ], |
| "class_name": "ClapAudioOutput", |
| "id": "encoder_block.output", |
| "kind": "feed_forward", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.output" |
| }, |
| { |
| "attributes": { |
| "in_features": 384, |
| "out_features": 96 |
| }, |
| "class_name": "Linear", |
| "id": "encoder_block.output.dense", |
| "kind": "projection", |
| "path_pattern": "model.audio_model.audio_encoder.layers.{i}.blocks.{j}.output.dense" |
| } |
| ] |
| } |
|
|