.. index:: 
  !DocumentLibrary.loadModel Method
  
.. _id3_document_document_library_load_model_class_method:

===============================================================================
DocumentLibrary.loadModel Method
===============================================================================

Module: :ref:`DocumentLibrary<id3_document_document_library_class>`

Definition
----------

Loads a model into memory from the specified directory.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        @staticmethod
        load_model(model_path: str, document_model: DocumentModel, processing_unit: ProcessingUnit) -> None

      **Parameters**

        .. line-block::

          ``model_path`` str
          :guilabel:`in` The path to directory containing the AI model files.

          ``document_model`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processing_unit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` Processing unit to load the model into.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        static void loadModel(String? modelPath, DocumentModel documentModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelPath`` String
          :guilabel:`in` The path to directory containing the AI model files.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` Processing unit to load the model into.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public static void LoadModel(string modelPath, DocumentModel documentModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelPath`` string
          :guilabel:`in` The path to directory containing the AI model files.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` Processing unit to load the model into.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public static void loadModel(String modelPath, DocumentModel documentModel, ProcessingUnit processingUnit) throws DocumentException

      **Parameters**

        .. line-block::

          ``modelPath`` String
          :guilabel:`in` The path to directory containing the AI model files.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` Processing unit to load the model into.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public static func loadModel(modelPath: String, documentModel: DocumentModel, processingUnit: ProcessingUnit) throws

      **Parameters**

        .. line-block::

          ``modelPath`` String
          :guilabel:`in` The path to directory containing the AI model files.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` Processing unit to load the model into.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3DocumentLibrary_LoadModel (
            const char * modelPath, 
            id3DocumentModel eDocumentModel, 
            id3DocumentProcessingUnit eProcessingUnit)

      **Parameters**

        .. line-block::

          ``modelPath`` const char *
          :guilabel:`in` The path to directory containing the AI model files.

          ``eDocumentModel`` :ref:`id3DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` The AI model to be loaded.

          ``eProcessingUnit`` :ref:`id3DocumentProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` Processing unit to load the model into.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3DocumentError<id3_document_document_error_enum>` file for the list of possible error codes.


