Model Configuration
Configuring a model source can be done by specifying a mapping with a python object. It allows you to point to specific
models you have created or gives the ability to access hugging face models.
Specify a Model discusses how to create a Python model file.
For an example of how to use this config in the model registry, please see the “Register a Model” step in Stress Tests walkthrough.
Template
Model Path
{
"model_path": {
"path": "path/to/model.py"
}
}
Huggingface
{
"hugging_face" : {
"model_uri": "cross-encoder/nli-MiniLM2-L6-H768",
"kwargs": "{\"tokenizer_uri\": \"cross-encoder/nli-MiniLM2-L6-H768\", \"class_map\": {\"0\": \"contradiction\", \"1\": \"entailment\", \"2\": \"neutral\"}, \"ignore_class_names\": true}"
}
}
Arguments
Parameter | Type | Description |
---|---|---|
model_path | JSON object | Specification for a model provided via a model file. |
path | String | Path to the Python model file. |
hugging_face | JSON object | Specification for a huggingface model. |
model_uri | String | The URI to a HuggingFace model. |
kwargs | String | A JSON String of arguments to pass to HuggingFace model. |
Specify exactly one of model_path
or hugging_face
.