| { |
| "architecture": { |
| "attention_variant": "MHA", |
| "family": "masked_lm", |
| "is_moe": false, |
| "mixer": "attention", |
| "positional": "learned", |
| "tie_word_embeddings": true, |
| "view": "encoder" |
| }, |
| "capabilities": { |
| "attention_backends": [ |
| "eager" |
| ], |
| "attention_patterns": [ |
| "bidirectional" |
| ], |
| "attention_schedule": null, |
| "task_heads": [ |
| "masked_lm", |
| "pretraining", |
| "question_answering", |
| "sequence_classification", |
| "text_encoding", |
| "token_classification" |
| ], |
| "tensor_parallel": false |
| }, |
| "components": [ |
| { |
| "children": [ |
| "embeddings", |
| "encoder" |
| ], |
| "class_name": "DebertaModel", |
| "id": "model", |
| "kind": "model", |
| "path_pattern": "model" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size" |
| }, |
| "children": [ |
| "embeddings.word_embeddings", |
| "embeddings.position_embeddings", |
| "embeddings.LayerNorm" |
| ], |
| "class_name": "DebertaEmbeddings", |
| "id": "embeddings", |
| "kind": "embedding", |
| "path_pattern": "model.embeddings" |
| }, |
| { |
| "attributes": { |
| "embedding_dim": "config.hidden_size", |
| "num_embeddings": "config.vocab_size", |
| "tied_lm_head": true |
| }, |
| "class_name": "Embedding", |
| "id": "embeddings.word_embeddings", |
| "kind": "embedding", |
| "path_pattern": "model.embeddings.word_embeddings" |
| }, |
| { |
| "attributes": { |
| "max_position_embeddings": "config.max_position_embeddings", |
| "scheme": "learned" |
| }, |
| "class_name": "Embedding", |
| "id": "embeddings.position_embeddings", |
| "kind": "position", |
| "path_pattern": "model.embeddings.position_embeddings" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "DebertaLayerNorm", |
| "id": "embeddings.LayerNorm", |
| "kind": "normalization", |
| "path_pattern": "model.embeddings.LayerNorm" |
| }, |
| { |
| "children": [ |
| "encoder_layers" |
| ], |
| "class_name": "DebertaEncoder", |
| "id": "encoder", |
| "kind": "encoder", |
| "path_pattern": "model.encoder" |
| } |
| ], |
| "config": { |
| "class_name": "DebertaConfig", |
| "model_type": "deberta", |
| "module": "transformers.models.deberta.configuration_deberta", |
| "referenced_fields": { |
| "num_hidden_layers": 12 |
| }, |
| "salient_fields": { |
| "hidden_act": "gelu", |
| "hidden_size": 768, |
| "intermediate_size": 3072, |
| "is_encoder_decoder": false, |
| "max_position_embeddings": 512, |
| "num_attention_heads": 12, |
| "num_hidden_layers": 12, |
| "tie_word_embeddings": true, |
| "vocab_size": 50265 |
| } |
| }, |
| "edges": [ |
| { |
| "kind": "data", |
| "source": "embeddings", |
| "target": "encoder" |
| }, |
| { |
| "kind": "data", |
| "source": "embeddings.word_embeddings", |
| "target": "embeddings.LayerNorm" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_layer.attention", |
| "target": "encoder_layer.intermediate" |
| }, |
| { |
| "kind": "data", |
| "source": "encoder_layer.intermediate", |
| "target": "encoder_layer.output" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer.attention" |
| }, |
| { |
| "kind": "mask", |
| "source": "input:attention_mask", |
| "target": "encoder_layer.attention.self" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.attention" |
| }, |
| { |
| "kind": "residual", |
| "source": "encoder_layer", |
| "target": "encoder_layer.intermediate" |
| }, |
| { |
| "kind": "position", |
| "source": "embeddings.position_embeddings", |
| "target": "embeddings" |
| }, |
| { |
| "kind": "data", |
| "provenance": "intra_module", |
| "source": "encoder_layer.attention.self", |
| "target": "encoder_layer.attention.self.in_proj" |
| }, |
| { |
| "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" |
| } |
| ], |
| "extends": null, |
| "model_type": "deberta", |
| "provenance": { |
| "config_class": "DebertaConfig", |
| "config_module": "transformers.models.deberta.configuration_deberta", |
| "model_class": "DebertaModel", |
| "model_module": "transformers.models.deberta.modeling_deberta" |
| }, |
| "repeats": [ |
| { |
| "body": "encoder_layer", |
| "container_path_pattern": "model.encoder.layer", |
| "count": 12, |
| "count_expr": "config.num_hidden_layers", |
| "count_source": "config", |
| "id": "encoder_layers", |
| "index_symbol": "i", |
| "item_path_pattern": "model.encoder.layer.{i}", |
| "kind": "symbolic_repeat", |
| "provenance": { |
| "class_name": "DebertaLayer", |
| "container_path_pattern": "model.encoder.layer", |
| "item_path_pattern": "model.encoder.layer.{i}", |
| "source": "module_tree_repeat_collapse" |
| }, |
| "repeated_class_name": "DebertaLayer" |
| } |
| ], |
| "schema_version": "architecture-template-v0", |
| "templates": [ |
| { |
| "children": [ |
| "encoder_layer.attention", |
| "encoder_layer.intermediate", |
| "encoder_layer.output" |
| ], |
| "class_name": "DebertaLayer", |
| "id": "encoder_layer", |
| "kind": "transformer_block", |
| "path_pattern": "model.encoder.layer.{i}" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 12, |
| "n_kv_heads": 12, |
| "pattern": "bidirectional", |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "encoder_layer.attention.self", |
| "encoder_layer.attention.output" |
| ], |
| "class_name": "DebertaAttention", |
| "id": "encoder_layer.attention", |
| "kind": "attention", |
| "path_pattern": "model.encoder.layer.{i}.attention" |
| }, |
| { |
| "attributes": { |
| "head_dim": 64, |
| "n_heads": 12, |
| "n_kv_heads": 12, |
| "pattern": "bidirectional", |
| "rope": false, |
| "variant": "MHA" |
| }, |
| "children": [ |
| "encoder_layer.attention.self.in_proj" |
| ], |
| "class_name": "DisentangledSelfAttention", |
| "id": "encoder_layer.attention.self", |
| "kind": "attention", |
| "path_pattern": "model.encoder.layer.{i}.attention.self" |
| }, |
| { |
| "attributes": { |
| "in_features": "config.hidden_size", |
| "out_features": 2304 |
| }, |
| "class_name": "Linear", |
| "id": "encoder_layer.attention.self.in_proj", |
| "kind": "projection", |
| "path_pattern": "model.encoder.layer.{i}.attention.self.in_proj" |
| }, |
| { |
| "children": [ |
| "encoder_layer.attention.output.LayerNorm" |
| ], |
| "class_name": "DebertaSelfOutput", |
| "id": "encoder_layer.attention.output", |
| "kind": "module", |
| "path_pattern": "model.encoder.layer.{i}.attention.output" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "DebertaLayerNorm", |
| "id": "encoder_layer.attention.output.LayerNorm", |
| "kind": "normalization", |
| "path_pattern": "model.encoder.layer.{i}.attention.output.LayerNorm" |
| }, |
| { |
| "attributes": { |
| "activation": "gelu", |
| "hidden_size": 768, |
| "intermediate_size": 3072 |
| }, |
| "children": [ |
| "encoder_layer.intermediate.dense" |
| ], |
| "class_name": "DebertaIntermediate", |
| "id": "encoder_layer.intermediate", |
| "kind": "feed_forward", |
| "path_pattern": "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.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": "DebertaOutput", |
| "id": "encoder_layer.output", |
| "kind": "feed_forward", |
| "path_pattern": "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.encoder.layer.{i}.output.dense" |
| }, |
| { |
| "attributes": { |
| "norm_type": "layer" |
| }, |
| "class_name": "DebertaLayerNorm", |
| "id": "encoder_layer.output.LayerNorm", |
| "kind": "normalization", |
| "path_pattern": "model.encoder.layer.{i}.output.LayerNorm" |
| } |
| ] |
| } |
|
|