This feature only applies to models trained in Code Repositories.
Recall that a model is the combination of model artifacts and a model adapter:
Sometimes, it can be useful to update the model adapter without changing or reproducing the model artifacts. For example:
load
, api
, predict
, or run_inference
method.However, updating the model adapter can also introduce breaking changes to the model's inference environment. The following must be kept in mind when making changes to a model adapter:
load
, api
, predict
, or run_inference
must be compatible with existing artifacts.It is highly recommended to exercise caution while updating a model adapter and to test changes first on a new branch.
Foundry enables upgrading a model version's model adapter to its most recent commit or tag while retaining its published model weights.
To upgrade a model adapter, first implement and publish changes to the model adapter class in the repository where it is defined. In the Model Training template in Code Repositories, changes will be published after every commit. In a Model Adapter template, changes will be published after a new tag is created.
Next, on the model application, scroll to the Inference Configuration card. Click Upgrade model adapter.
Clicking Create model version will create a new model version using the updated model adapter with the previously published model artifacts.
If the previous model version has been submitted to a modeling objective, the updated model version will not automatically be submitted and must be submitted again.