Models subcommands
Publish Machine Learning models
The publish
subcommand is used to export local Machine learning models to an Arkindex instance.
These models used to be stored in Git repositories, and now a new storage system is being implemented on Arkindex. The publish
subcommand is a temporary tool used to migrate existing models towards this new system.
Usage
arkindex models publish
This command is meant to be launched in a Git repository. It uses the .arkindex.yml
configuration file, located at the root of the repository. Multiple workers may be declared, assuming they
follow the convention available on the Arkindex documentation.
To make the connection to the Arkindex instance easier, you may set the ARKINDEX_API_URL
and ARKINDEX_API_TOKEN
variables in your environment. This is recommended when calling this command in Docker containers.
This script creates an archive with all the files needed by the worker to use the model and uploads it to the Arkindex storage system. To find these files, the script looks for the path declared as model
in the worker YAML configuration. Multiple cases are supported:
- if the model path points to a folder, it will export this folder,
- if the model path points to a single required file, it will export this file,
- if the model path points to a single file but other files in the same folder are required for the worker to function, you need to use the
--use-parent-folder
argument to publish the folder containing these files.
The exported model version will also include the specified worker configuration.
If you want your model to have a model version tag then you need to set the CI_COMMIT_TAG
environment variable.