.. index:: 
  !DocumentLibrary.loadModelBuffer Method
  
.. _id3_document_document_library_load_model_buffer_class_method:

===============================================================================
DocumentLibrary.loadModelBuffer Method
===============================================================================

Module: :ref:`DocumentLibrary<id3_document_document_library_class>`

Definition
----------

Loads a model into memory from the specified buffer.


.. tab-set::

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

      .. code:: Python

        @staticmethod
        load_model_buffer(model_buffer: bytearray, document_model: DocumentModel, processing_unit: ProcessingUnit) -> None

      **Parameters**

        .. line-block::

          ``model_buffer`` bytearray
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``document_model`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` Doc model to load.

          ``processing_unit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` The processing unit to use for the model.


      **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 loadModelBuffer(Uint8List? modelBuffer, DocumentModel documentModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelBuffer`` Uint8List
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` Doc model to load.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` The processing unit to use for the model.


      **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 LoadModelBuffer(byte[] modelBuffer, DocumentModel documentModel, ProcessingUnit processingUnit)

      **Parameters**

        .. line-block::

          ``modelBuffer`` byte[]
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` Doc model to load.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` The processing unit to use for the model.


      **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 loadModelBuffer(byte[] modelBuffer, DocumentModel documentModel, ProcessingUnit processingUnit) throws DocumentException

      **Parameters**

        .. line-block::

          ``modelBuffer`` byte[]
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` Doc model to load.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` The processing unit to use for the model.


      **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 loadModelBuffer(modelBuffer: [UInt8], documentModel: DocumentModel, processingUnit: ProcessingUnit) throws

      **Parameters**

        .. line-block::

          ``modelBuffer`` [UInt8]
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``documentModel`` :ref:`DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` Doc model to load.

          ``processingUnit`` :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` The processing unit to use for the model.


      **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_LoadModelBuffer (
            unsigned char * modelBuffer, 
            int modelBufferSize, 
            id3DocumentModel eDocumentModel, 
            id3DocumentProcessingUnit eProcessingUnit)

      **Parameters**

        .. line-block::

          ``modelBuffer`` unsigned char *
          :guilabel:`in` A buffer containing the AI model to be loaded.

          ``modelBufferSize`` int
          :guilabel:`in` Size of the 'modelBuffer' buffer.

          ``eDocumentModel`` :ref:`id3DocumentModel<id3_document_document_model_enum>`
          :guilabel:`in` Doc model to load.

          ``eProcessingUnit`` :ref:`id3DocumentProcessingUnit<id3_document_processing_unit_enum>`
          :guilabel:`in` The processing unit to use for the model.


      **Returns**

        .. line-block::

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


