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. The Specify a Model section 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 the Stress Tests walkthrough.

Model Path

Load a model from a file.

{
  "model_path": {
    "path": "path/to/model.py"
  }
}

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

Load a model from Hugging Face.

{
  "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
hugging_face JSON object Specification for a Hugging Face model.
     model_uri String The URI to a Hugging Face model.
     kwargs String A JSON String of arguments to pass to Hugging Face model.

Note: Specify exactly one of model_path or hugging_face.