Updated on 2024-04-30 GMT+08:00

Importing a Meta Model from a Training Job

You can create a training job in ModelArts to obtain a satisfactory model. Then, you can import the model to AI Application Management for centralized management. In addition, you can quickly deploy the model as a service.

Constraints

Prerequisites

  • The training job has been successfully executed, and the model has been stored in the OBS directory where the training output is stored (the input parameter is train_url).
  • If a model is generated from a training job that uses a frequently-used framework or custom image, upload the inference code and configuration file to the storage directory of the model by referring to Introduction to Model Package Specifications.
  • The OBS directory you use and ModelArts are in the same region.

Creating an AI Application

  1. Log in to the ModelArts management console and choose AI Application Management > AI Applications in the left navigation pane. The AI Applications page is displayed.
  2. Click Create in the upper left corner.
  3. On the displayed page, set the parameters.
    1. Set basic information about the AI application. For details about the parameters, see Table 1.
      Table 1 Parameters of basic AI application information

      Parameter

      Description

      Name

      Application name. The value can contain 1 to 64 visible characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

      Version

      Version of the AI application to be created. For the first import, the default value is 0.0.1.

      NOTE:

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

      Description

      Brief description of an AI application

    2. Select the meta model source and set related parameters. Set Meta Model Source to Training job. For details about the parameters, see Table 2.
      Figure 1 Setting a training job as the meta model source
      Table 2 Parameters of the meta model source

      Parameter

      Description

      Meta Model Source

      Choose Training Job > Training Jobs or Training Job > Training Jobs (New).

      • Select a training job that has completed training under the current account and a training version from the drop-down lists on the right of Training Job and Version respectively.
      • Dynamic loading: enabled for quick deployment and model update. If this function is selected, model files and runtime dependencies are pulled only during an actual deployment. Enable this function if a single model file is larger than 5 GB.
      NOTE:

      ModelArts provides model training of both the new and old versions. Training management of the old version is only available for its existing users.

      AI Engine

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

      Inference Code

      Set inference code for an AI application. The code is used to customize the inference processing logic. Display the inference code URL. You can copy this URL directly.

      Runtime Dependency

      List the dependencies of the selected model in the environment. For example, if tensorflow is used and the installation method is pip, the version must be 1.8.0 or later.

      AI Application Description

      Provide AI application descriptions to help other AI application developers better understand and use your applications. Click Add AI Application Description and set the Document name and URL. A maximum of three AI application descriptions are supported.

      Deployment Type

      Select the service types that the application can be deployed. When deploying a service, only the service types selected here are available. For example, if you only select Real-time services here, you can only deploy the AI application as a real-time service after it is created.

    3. Confirm the configurations and click Create now. The AI application is created.

      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 successfully created. On this page, you can perform such operations as creating new versions and quickly deploying services.

Follow-Up Procedure

Deploying an AI Application as a Service: In the AI application list, click the option button on the left of the AI application name to display the version list at the bottom of the list page. Locate the row that contains the target version, click Deploy in the Operation column to deploy the AI application as a deployment type selected during AI application creation.