Find Your Models
The main model interface is found:
- for project-associated models: the “Models” tab under the project
- for all models: “Hi, Username! ⌄” ⇒ “View Organization!” ⇒ “Models”
Project-Associated Models?
By default, models don’t appear under each project, but you can associate a model with a project to make them visible in the context of that project.
Models created through project views are automatically associated with that project. Models created through organization views have controls to associate them with a project of your choosing. Both configurations can later be changed through the organization’s model settings.
You are still able to use these project-associated models in other projects as long as you have access to the model; you can refer to them with the model://<slug>/<version>
URL like usual.
This project association is foremost a way to visually organize models so you can find and operate on relevant models more easily.
Both model access and project association can be managed through the organization settings under the “Models” tab.
Define a Model
To create a new model, click the “Create model” button in either of the model listing views. This will show the controls for naming your model.
If you are creating a model through the organization settings, you can also associate the model with a project. This is optional and can be changed later.
If you are creating a model through a project, the model will be automatically associated with that project. This auto-association can be changed later.
Model Versions
Each model has one or more versions that consists of one or more files each. You can view all the model versions under the “Model versions” dropdown.
To create a model version, click the “Create version” button under your model view. You can select one or more files from your data library. To search files, you can use wildcards.
New model versions will start in the Pending state and should be reviewed before promoting them to Approved state; or demoting them to Rejected state.
You can also create model versions using the Valohai API with a POST
message to https://app.valohai.com/api/v0/model-versions/
with a payload like:
{
"model": "0191dc31-1111-2222-3333-e83255c3468d",
"datums": ["0191dbea-1111-2222-3333-4859cdea11f2"]
}
You can find the model and datum (i.e. file) IDs through the Valohai API.
Use Your Models
Similarly to dataset versions and datums, you can use models as inputs in your workloads. Each model version has a URL that can be added to the valohai.yaml
file, and API call or used in the UI when starting an execution.
inputs:
- name: model
default: model://<model-slug>/<model-version>
optional: false
The <model-version>
refers to the version number. You can also refer to the latest version with the alias latest
.
Tip
You can find the model URL under the model version details.