Class OrtLoraAdapter

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class OrtLoraAdapter
    extends java.lang.Object
    implements java.lang.AutoCloseable
    A container for an adapter which can be supplied to OrtSession.RunOptions.addActiveLoraAdapter(OrtLoraAdapter) to apply the adapter to a specific execution of a model.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      static OrtLoraAdapter create​(byte[] loraArray)
      Creates an instance of OrtLoraAdapter from a byte array.
      static OrtLoraAdapter create​(java.lang.String adapterPath)
      Creates an instance of OrtLoraAdapter.
      static OrtLoraAdapter create​(java.nio.ByteBuffer loraBuffer)
      Creates an instance of OrtLoraAdapter from a direct ByteBuffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static OrtLoraAdapter create​(byte[] loraArray)
                                     throws OrtException
        Creates an instance of OrtLoraAdapter from a byte array.
        Parameters:
        loraArray - The LoRA stored in a byte array.
        Returns:
        An OrtLoraAdapter instance.
        Throws:
        OrtException - If the native call failed.
      • create

        public static OrtLoraAdapter create​(java.nio.ByteBuffer loraBuffer)
                                     throws OrtException
        Creates an instance of OrtLoraAdapter from a direct ByteBuffer.
        Parameters:
        loraBuffer - The buffer to load.
        Returns:
        An OrtLoraAdapter instance.
        Throws:
        OrtException - If the native call failed.
      • create

        public static OrtLoraAdapter create​(java.lang.String adapterPath)
                                     throws OrtException
        Creates an instance of OrtLoraAdapter.
        Parameters:
        adapterPath - path to the adapter file that is going to be memory mapped.
        Returns:
        An OrtLoraAdapter instance.
        Throws:
        OrtException - If the native call failed.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable