Model Search Path¶
Most commands/APIs support providing a model name argument (as opposed to a file path). e.g:
mltk train image_example1 mltk profile my_model mltk evaluate keyword_spotting_model
mltk_model = load_mltk_model('image_example1') train_model('image_example1') profile_model('my_model') evaluate_model('keyword_spotting_model')
The MLTK searches the following paths for a model specification script
.py and/or model archive file
.mltk.zip with a matching name:
model_paths in user_settings.yaml
The user_settings.yaml file may contain the field
model_pathswhich should be a list of directories containing model specification scripts. If the setting field exists, these directories are recursively searched in the provided order.
Current working directory
The current working directory (not including the MLTK Python package/repository root directory) is searched (not recursively).
Environment Variable: MLTK_MODEL_PATHS
The environment variable MLTK_MODEL_PATHS may contain a list of model search directories. If the environment variable exists, these directories are recursively searched in the provided order.
MLTK package module: mltk.models
The default search path is the
mltk.modelsmodule directory which is recursively searched.