Skip to content

Instantly share code, notes, and snippets.

@qtangs
Last active January 27, 2025 10:12
Show Gist options
  • Save qtangs/ca754167f38767bec6b6ddfaa0320fae to your computer and use it in GitHub Desktop.
Save qtangs/ca754167f38767bec6b6ddfaa0320fae to your computer and use it in GitHub Desktop.
Test Models JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"models": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_\\-\\./]+$": {
"type": "object",
"properties": {
"model": {
"type": "string",
"default": null
},
"task": {
"type": "string",
"enum": ["feature-extraction", "text-classification"],
"default": "text-classification"
},
"framework": {
"type": "string",
"enum": ["pt", "onnx"],
"default": "pt"
},
"model_args": {
"type": "object"
},
"tokenizer_args": {
"type": "object"
},
"handler": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)*\.[A-Z][a-zA-Z0-9_]*$",
"default": null
},
"pipeline": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)*\.[A-Z][a-zA-Z0-9_]*$",
"default": null
},
"pipeline_args": {
"type": "object"
}
}
}
},
"additionalProperties": false
}
},
"required": ["models"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment