Updated on 2024-10-29 GMT+08:00

Importing a Meta Model from a Training Job

Create a training job in ModelArts to obtain a satisfactory model. The model can then be imported to create an AI application for centralized management. The application can be quickly deployed as a service.

Constraints

Prerequisites

  • The training job has been executed, and the model has been stored in the OBS directory where the training output is stored (the input parameter is train_url).
  • If the training job uses a mainstream framework or custom image, upload the inference code and configuration file to the model storage directory by referring to Model Package Structure.
  • The OBS directory you use must be in the same region as ModelArts.

Procedure

  1. Log in to the ModelArts console. In the navigation pane, choose AI Applications.
  2. Click Create Applications.
  3. Configure parameters.
    1. Enter basic information. For details, see Table 1.
      Table 1 Basic information

      Parameter

      Description

      Name

      Name of the AI application. The value can contain 1 to 64 visible characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

      Version

      Version of the AI application. The default value is 0.0.1 for the first import.

      NOTE:

      After an AI application is created, you can create new versions using different meta models for optimization.

      Description

      Brief description of the AI application.

    2. Set Meta Model Source to Training job. For details, see Table 2.
      Figure 1 Importing a meta model from a training job

      Table 2 Meta model source parameters

      Parameter

      Description

      Meta Model Source

      Select Training job.

      • Choose a training job from the Training Job drop-down list.
      • Dynamic loading: You can enable it for quick model deployment and update. When it is enabled, model files and runtime dependencies are only pulled during an actual deployment. Enable this feature if a single model file is larger than 5 GB.

      AI Engine

      Inference engine used by the meta model, which is automatically matched based on the training job you select.

      Inference Code

      Inference code customizing the inference logic of the AI application. You can directly copy the inference code URL for use.

      Runtime Dependency

      Dependencies that the selected model has on the environment. For example, if you need to install tensorflow using pip, make sure the version is 1.8.0 or newer.

      AI Application Description

      AI application descriptions to help other developers better understand and use your application. Click Add AI Application Description and set the document name and URL. You can add up to three AI application descriptions.

      Deployment Type

      Choose the service types for application deployment. The service types you select will be the only options available for deployment. For example, selecting Real-Time Services means the AI application can only be deployed as real-time services.

    3. Confirm the configurations and click Create now.

      In the AI application list, you can view the created AI application and its version. When the status changes to Normal, the AI application is created. On this page, you can perform such operations as creating new versions and quickly deploying services.

Follow-Up Operations

Deploying a service: In the AI application list, click Deploy in the Operation column of the target AI application. Locate the target version, click Deploy and choose a service type selected during AI application creation.