Package ai.onnxruntime
Class OrtLoraAdapter
- java.lang.Object
-
- ai.onnxruntime.OrtLoraAdapter
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class OrtLoraAdapter extends java.lang.Object implements java.lang.AutoCloseableA container for an adapter which can be supplied toOrtSession.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 voidclose()static OrtLoraAdaptercreate(byte[] loraArray)Creates an instance of OrtLoraAdapter from a byte array.static OrtLoraAdaptercreate(java.lang.String adapterPath)Creates an instance of OrtLoraAdapter.static OrtLoraAdaptercreate(java.nio.ByteBuffer loraBuffer)Creates an instance of OrtLoraAdapter from a direct ByteBuffer.
-
-
-
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:
closein interfacejava.lang.AutoCloseable
-
-