Package ai.onnxruntime
Class OrtLoraAdapter
java.lang.Object
ai.onnxruntime.OrtLoraAdapter
- All Implemented Interfaces:
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
Modifier and TypeMethodDescriptionvoidclose()static OrtLoraAdaptercreate(byte[] loraArray) Creates an instance of OrtLoraAdapter from a byte array.static OrtLoraAdapterCreates an instance of OrtLoraAdapter.static OrtLoraAdaptercreate(ByteBuffer loraBuffer) Creates an instance of OrtLoraAdapter from a direct ByteBuffer.
-
Method Details
-
create
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
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
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 interfaceAutoCloseable
-