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

Importing a Meta Model from a Template

Importing a model from a template will be unavailable soon. After it goes offline, you can use the templates for AI engine and model configurations by choosing OBS, setting AI Engine to Custom, and importing your custom AI engine.

Because the configurations of models with the same functions are similar, ModelArts integrates the configurations of such models into a common template. By using this template, you can easily and quickly create AI applications without compiling the config.json configuration file. For details about the template, see Introduction to Model Templates.

Constraints

Prerequisites

  • Ensure that you have uploaded the model to OBS according to the model package specifications of the corresponding template.
  • 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 Template. For details about the parameters, see Table 2.
      Figure 1 Setting a template as the meta model source
      Table 2 Parameters of the meta model source

      Parameter

      Description

      Model Template

      Select a template from the existing ModelArts template list , such as TensorFlow-based image classification template.

      ModelArts also provides three filter criteria: Type, Engine, and Environment, helping you quickly find the desired template. If the three filter criteria cannot meet your requirements, you can enter keywords to search for the target template. For details about the supported templates, see Supported Templates.

      Model Directory

      OBS path where a model is saved. Select an OBS path for storing the model based on the input requirements of the selected model template.

      The OBS path cannot contain spaces. Otherwise, the AI application fails to be created.

      NOTE:
      • If you select an encrypted bucket or file, the import will fail.
      • If a training job is executed for multiple times, different version directories are generated, such as V001 and V002, and the generated models are stored in the model folder in different version directories. When selecting model files, specify the model folder in the corresponding version directory.

      Dynamic Loading

      Quick deployment and model update. If this function is selected, model files and runtime dependencies are pulled only during an actual deployment. Select this function if the size of a single model file exceeds 5 GB.

      Input and Output Mode

      If the default input and output mode of the selected template can be overwritten, you can select an input and output mode based on the AI application function or application scenario. Input and Output Mode is an abstract of the API (apis) in config.json. It describes the interface provided by the AI application for external inference. An input and output mode describes one or more APIs, and corresponds to a template.

      For example, for TensorFlow-based image classification template, Input and Output Mode supports Built-in image processing mode. The input and output mode cannot be modified in the template. Therefore, you can only view but not modify the default input and output mode of the template on the page.

      For details about the supported input and output modes, see Supported Input and Output Modes.

      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. You can add up to three AI application descriptions.

      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. Check the information and click Next. 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.