# Managing ML packages

> For models uploaded with the **Enable Training** flag **inactive**, when a model is uploaded, AI Center validates the uploaded `.zip` file against the requirements. The following three checks are performed:

## Package validations

### For serving

For models uploaded with the **Enable Training** flag **inactive**, when a model is uploaded, AI Center validates the uploaded `.zip` file against the requirements. The following three checks are performed:

1. A non-empty root folder exists.
2. A **requirements.txt** file exists.
3. A file named **main.py** exists in the root folder which implements a class **Main**. The class is further validated to implement an `__init__` and a `predict` function.

Success or failure along with any errors that caused it are shown on the **ML Logs** page.

### For training

For models uploaded with the **Enable Training** flag **active**, in addition to validating the requirements, AI Center also validates the uploaded `.zip` file against the requirements. For these packages the following two checks are performed:

1. A non-empty root folder exists.
2. A file named **train.py** exists in the root folder which implements a class **Main**. The class is further validated to implement an `__init__` function and the following functions: `train`, `evaluate`, and `save`.

Success or failure along with any errors that caused it are shown on the **ML Logs** page.

## Viewing ML package details

Select a package in the list to navigate to its **ML Package > [ML Package Name]** page.

In the **Version** tab, view its details: package version, creation time, change log, status, whether or not training is enabled, whether or not recommended GPU is enabled, and arguments.

   ![Screenshot including the Version tab in UiPath AI Center.](https://dev-assets.cms.uipath.com/assets/images/ai-center/ai-center-screenshot-including-the-version-tab-in-uipath-ai-center-450501-c8c53850-2b2f26a4.webp)

You can find more information on each entry in the ML Packages Version by selecting the three-dot ⁝ icon and then **Details**. A dialog box will be displayed with all the information on the package version.

   ![Screenshot including the ML Packages version information window in UiPath AI Center.](https://dev-assets.cms.uipath.com/assets/images/ai-center/ai-center-screenshot-including-the-ml-packages-version-information-window-in-uipath-ai-center-107622-a458f3a5-f5a65a50.webp)

In the **Pipeline runs** tab, view the details related to the package's pipeline runs: package name, type, version, status, creation time, duration, score, and additional details.

## Version control

AI Center also supports versioning and version management of packages. When a package is uploaded, it's displayed as version **1.0** of that package (we say it's **Major Version** is **1**, and **Minor Version** is **0**). This helps with differentiating between packages uploaded by users, and packages retrained via pipelines, the latter only changing their minor version.

### Uploading new ML package versions

Follow these steps to upload a new version for an already uploaded package:

1. In the **ML Packages** page, select the three-dot ⁝ icon next to a package and select the **Upload new version** option.

   Alternatively, in the **ML Package > [ML Package Name]** page, select **Upload new version**. The **Upload New Package Version for > [ML Package Name]** window is displayed, with most of the fields prefilled with the information you provided at the time when you first uploaded that package.

2. Select **Upload Package** to select the desired `.zip` file, or drag & drop the file above this field.
3. **Optional:** Update the existing information in the following fields:
   * Input description
   * Output description
   * Language
4. **Optional:** In the **ChangeLog** field, enter what has changed.
5. Select whether the model requires a **GPU**, by default it is set to No.
6. Select whether to **enable training** for your model.
7. Select **Create** to upload the new version for the existing uploaded package or **Cancel** to abort the process. The **Upload Package** window is closed and the new version of the package is uploaded. It may take a few minutes before your upload is propagated.

The new version of the package is not visible directly in the **ML Packages** page. You can view its information within the **ML Package Details** page for that package.

:::note
When a new version is uploaded on an existing package, that creates a new major version. For example, if I have uploaded my first package, that upload will be version **1.0**. When I upload a new version, that version will be **2.0**.
:::

### ML package versions created by training pipelines

When a **training pipeline** or a **full pipeline** executes successfully on a package version, a new minor version is created. For example, if I have uploaded a package (version 1.0), and start a training pipeline, version **1.1** is displayed after completion in the **ML Package Details** page as in the following screenshot:

   ![Screenshot including the ML Packages version in UiPath AI Center.](https://dev-assets.cms.uipath.com/assets/images/ai-center/ai-center-screenshot-including-the-ml-packages-version-in-uipath-ai-center-109182-c7a8f001-85467374.webp)

### Viewing package arguments

In the **ML Package > [ML Package Name]** page **Version** tab, select the information icon next to a package version. The **Arguments for > [ML Package Name] > [ML Package Version]** window is displayed.

The input type, and the input and output descriptions of the selected package version are displayed. Please note that you cannot edit the values.

## Deleting ML packages

Packages can only be deleted if they are not deployed within a skill and no pipelines are currently running on those packages.

1. In the **ML Packages** page, select the three-dot ⁝ icon next to a package and select **Delete undeployed versions**. A confirmation window is displayed.
2. In the confirmation window, select **OK** to delete all undeployed versions of the selected package. If a package version is part of a skill (it is active), **it is NOT going to be deleted**. If all the versions are inactive, they are all deleted.

OR

1. In the **ML Package > [ML Package Name]** page **Version** tab, select the three-dot ⁝ icon next to a package version and select **Delete**. A confirmation window is displayed.
2. In the confirmation window, select **OK** to delete the selected version of the package. If a package version is part of a skill (it is active), **it is NOT going to be deleted**. If this is the only version for the selected package, the package itself is also deleted.
