:original_name: modelarts_23_0062.html
.. _modelarts_23_0062:
Testing a Service
=================
After a model is deployed as a real-time service, you can debug code or add files for testing on the **Prediction** tab page. Based on the input request (JSON text or file) defined by the model, the service can be tested in either of the following ways:
#. :ref:`JSON Text Prediction `: If the input type of the model of the deployed service is JSON text, that is, the input does not contain files, you can enter the JSON code on the **Prediction** tab page for service testing.
#. :ref:`File Prediction (Images and Audios) `: If the input type of the model of the deployed service is file, including images, audios, and videos, you can add images on the **Prediction** tab page for service testing.
.. note::
- If the input type is image, the size of a single image must be less than 10 MB.
- The following image types are supported: png, psd, jpg, jpeg, bmp, gif, webp, psd, svg, and tiff.
Input Parameters
----------------
For the service that you have deployed, you can learn about its input parameters of the service, that is, the input request type mentioned above, on the **Usage Guides** tab page of the service details page.
.. figure:: /_static/images/en-us_image_0000001234603134.png
:alt: **Figure 1** Viewing the Usage Guides tab page
**Figure 1** Viewing the Usage Guides tab page
The input parameters displayed on the **Usage Guides** tab page depend on the model source that you select.
- If you use a custom model with the inference code and configuration file compiled by yourself (:ref:`Specifications for Compiling the Model Configuration File `), the **Usage Guides** tab page only visualizes your data. The following figure shows the mapping between the input parameters displayed on the **Usage Guides** tab page and the configuration file.
.. figure:: /_static/images/en-us_image_0000001157080793.png
:alt: **Figure 2** Mapping between the configuration file and Usage Guides
**Figure 2** Mapping between the configuration file and Usage Guides
- If your model is imported using a model template, the input and output parameters vary with the template. For details, see :ref:`Introduction to Model Templates `.
.. _modelarts_23_0062__en-us_topic_0165025306_section15840106121611:
JSON Text Prediction
--------------------
#. Log in to the ModelArts management console and choose **Service Deployment** > **Real-Time Services**.
#. On the **Real-Time Services** page, click the name of the target service. The service details page is displayed. On the **Prediction** tab page, enter the prediction code and click **Predict** to perform prediction.
.. figure:: /_static/images/en-us_image_0000001157080799.png
:alt: **Figure 3** Prediction code
**Figure 3** Prediction code
.. _modelarts_23_0062__en-us_topic_0165025306_section1666533761611:
File Prediction (Images and Audios)
-----------------------------------
#. Log in to the ModelArts management console and choose **Service Deployment** > **Real-Time Services**.
#. On the **Real-Time Services** page, click the name of the target service. The service details page is displayed. On the **Prediction** tab page, click **Upload** and select a test file. After the file is uploaded successfully, click **Predict** to perform a prediction test.
.. figure:: /_static/images/en-us_image_0000001165916474.png
:alt: **Figure 4** Image prediction
**Figure 4** Image prediction