-
Notifications
You must be signed in to change notification settings - Fork 32
[WIP] schema: add draft architecture config JSON Schema #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,344 @@ | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| "description": "ModelPack Architecture Configuration Schema", | ||||||||||||||||||||||||||||||||
| "$schema": "http://json-schema.org/draft-04/schema#", | ||||||||||||||||||||||||||||||||
| "$id": "https://github.com/modelpack/model-spec/architecture", | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "architecture_version": { | ||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "transformer": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/TransformerArchitecture" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "transformer" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false, | ||||||||||||||||||||||||||||||||
| "$defs": { | ||||||||||||||||||||||||||||||||
| "TransformerArchitecture": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "type": { | ||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||
| "enum": ["decoder"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "vocabulary_size": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "hidden_size": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+26
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||||||||||||||||||||
| "tokenizer": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/Tokenizer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "token_embedding": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/TokenEmbedding" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "position_embedding": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/PositionEmbedding" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "normalization": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/Normalization" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "uniform_layers": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/UniformLayers" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "mixed_layers": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/MixedLayers" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "type", | ||||||||||||||||||||||||||||||||
| "vocabulary_size", | ||||||||||||||||||||||||||||||||
| "hidden_size", | ||||||||||||||||||||||||||||||||
| "tokenizer", | ||||||||||||||||||||||||||||||||
| "token_embedding", | ||||||||||||||||||||||||||||||||
| "position_embedding", | ||||||||||||||||||||||||||||||||
| "normalization" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false, | ||||||||||||||||||||||||||||||||
| "oneOf": [ | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| "required": ["uniform_layers"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| "required": ["mixed_layers"] | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "Tokenizer": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "type": { | ||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||
| "enum": ["bpe"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "library": { | ||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||
| "enum": ["huggingface"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "revision": { | ||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "type", | ||||||||||||||||||||||||||||||||
| "library" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "TokenEmbedding": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "has_bias": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_norm": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "shared_embedding": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "PositionEmbedding": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "type": { | ||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||
| "enum": ["rope"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "max_position_embeddings": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+113
to
+115
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "rope_theta": { | ||||||||||||||||||||||||||||||||
| "type": "number" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "rope_scaling": { | ||||||||||||||||||||||||||||||||
| "type": "object" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
Comment on lines
+119
to
+121
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding your open question on |
||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "type", | ||||||||||||||||||||||||||||||||
| "max_position_embeddings" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "Attention": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "type": { | ||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||
| "enum": ["mha", "gqa", "mla"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "is_causal": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "num_attention_heads": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "num_key_value_heads": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "head_dim": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+139
to
+147
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "num_attention_heads": {
"type": "integer",
"minimum": 1
},
"num_key_value_heads": {
"type": "integer",
"minimum": 1
},
"head_dim": {
"type": "integer",
"minimum": 1
},
|
||||||||||||||||||||||||||||||||
| "is_qkv_merged": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_qkv_bias": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_output_bias": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_pre_norm": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_post_norm": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_residual": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "type", | ||||||||||||||||||||||||||||||||
| "is_causal", | ||||||||||||||||||||||||||||||||
| "num_attention_heads", | ||||||||||||||||||||||||||||||||
| "num_key_value_heads" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "MLP": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "intermediate_size": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+178
to
+180
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "activation": { | ||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+181
to
+183
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "use_gated_activation": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "is_mlp_merged": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_bias": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_residual": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_pre_norm": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_post_norm": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "intermediate_size", | ||||||||||||||||||||||||||||||||
| "activation" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "MoE": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "num_experts": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "top_k": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "moe_intermediate_size": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+212
to
+220
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "num_shared_experts": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "shared_expert_intermediate_size": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "scoring_function": { | ||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+227
to
+229
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "norm_topk_prob": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "activation": { | ||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+233
to
+235
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "use_gated_activation": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "has_bias": { | ||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "num_experts", | ||||||||||||||||||||||||||||||||
| "top_k", | ||||||||||||||||||||||||||||||||
| "moe_intermediate_size", | ||||||||||||||||||||||||||||||||
| "scoring_function", | ||||||||||||||||||||||||||||||||
| "activation" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "Normalization": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "type": { | ||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||
| "enum": ["rmsnorm", "layernorm"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "epsilon": { | ||||||||||||||||||||||||||||||||
| "type": "number" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "type" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "UniformLayers": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "num_layers": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+271
to
+273
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "attention": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/Attention" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "mlp": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/MLP" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "moe": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/MoE" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "num_layers", | ||||||||||||||||||||||||||||||||
| "attention" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
| "additionalProperties": false, | ||||||||||||||||||||||||||||||||
| "oneOf": [ | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| "required": ["mlp"] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| "required": ["moe"] | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "MixedLayers": { | ||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||
| "num_layers": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+301
to
+303
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "mlp_layers": { | ||||||||||||||||||||||||||||||||
| "type": "array", | ||||||||||||||||||||||||||||||||
| "items": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+304
to
+309
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "moe_frequency": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+310
to
+312
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| "pre_norm_layers": { | ||||||||||||||||||||||||||||||||
| "type": "array", | ||||||||||||||||||||||||||||||||
| "items": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "post_norm_layers": { | ||||||||||||||||||||||||||||||||
| "type": "array", | ||||||||||||||||||||||||||||||||
| "items": { | ||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
|
Comment on lines
+313
to
+324
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The items in "pre_norm_layers": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0
}
},
"post_norm_layers": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0
}
},
|
||||||||||||||||||||||||||||||||
| "attention": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/Attention" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "mlp": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/MLP" | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "moe": { | ||||||||||||||||||||||||||||||||
| "$ref": "#/$defs/MoE" | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||
| "required": [ | ||||||||||||||||||||||||||||||||
| "num_layers", | ||||||||||||||||||||||||||||||||
| "attention", | ||||||||||||||||||||||||||||||||
| "mlp_layers", | ||||||||||||||||||||||||||||||||
| "moe_frequency" | ||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||
|
Comment on lines
+335
to
+340
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding your question on "required": [
"num_layers",
"attention",
"mlp_layers",
"moe_frequency",
"mlp",
"moe"
],
|
||||||||||||||||||||||||||||||||
| "additionalProperties": false | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding your question about vendor extensions, a common pattern to allow for extensions while maintaining strict validation is to use
patternProperties. You could add apatternPropertiesfield to the root object to allow any property prefixed withx-for vendor-specific data. This provides an explicit extension point without opening up the schema completely.For example: