Evaluating or stress testing a model requires Efemarai to load it first in order to pass data through it.


The following definition

    entrypoint: inference:get_model

      - name: config_url
        value: cfg/yolor_p6.cfg

      - name: params_url
        value: ${model.files.params.url}

      name: model

describes a Python function in inference.py (expected to be in the base of the model repo) which for example could look like

def get_model(config_url, params_url, device):
   """ Loads the model.

       config_url (str): Configuration file name.
       params_url (str): Trained weights file name.
       device (str): Device name passed in by default.

      An initialized and loaded CarDetector model.
   model = CarDetector(config_url)
   return model

In this case config_url="cfg/yolor_pt.cfg" is just a string value, params_url is set to a path where the specified model file is located within the model runtime. See Variables for more details.


  • entrypoint: specifies where the user function is in the format user_module:user_function. The module must be importable from the root of the model repository and it must contain the specified function. Sub-modules are also supported with the standard import syntax using dots e.g. module.submodule:function

  • inputs: specifies a list of name-value pairs that will be passed as input arguments to the user function. Names must be valid Python variable names. Values are parsed from the YAML file and directly passed to the user function unless they refer to runtimes variable in which case they are substituted with the correct values first (see Variables). The runtime device is passed by default to the user function so it must not be explicitly specified as an input (see runtime).

  • output: specifies the output of the user function. It should contain a name field that can be used to refer to the output as a runtime variable.