Class OrtLoraAdapter
Represents Lora Adapter in memory
Implements
Inherited Members
Namespace: Microsoft.ML.OnnxRuntime
Assembly: Microsoft.ML.OnnxRuntime.dll
Syntax
public class OrtLoraAdapter : SafeHandle, IDisposable
Properties
| Improve this Doc View SourceIsInvalid
Overrides SafeHandle.IsInvalid
Declaration
public override bool IsInvalid { get; }
Property Value
| Type | Description |
|---|---|
| bool | returns true if handle is equal to Zero |
Overrides
Methods
| Improve this Doc View SourceCreate(byte[], OrtAllocator)
Creates an instance of OrtLoraAdapter from an array of bytes. The API makes a copy of the bytes internally.
Declaration
public static OrtLoraAdapter Create(byte[] bytes, OrtAllocator ortAllocator)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | array of bytes containing valid LoraAdapter format |
| OrtAllocator | ortAllocator | optional device allocator or null |
Returns
| Type | Description |
|---|---|
| OrtLoraAdapter | new instance of LoraAdapter |
Create(string, OrtAllocator)
Creates an instance of OrtLoraAdapter from file. The adapter file is memory mapped. If allocator parameter is provided, then lora parameters are copied to the memory allocated by the specified allocator.
Declaration
public static OrtLoraAdapter Create(string adapterPath, OrtAllocator ortAllocator)
Parameters
| Type | Name | Description |
|---|---|---|
| string | adapterPath | path to the adapter file |
| OrtAllocator | ortAllocator | optional allocator, can be null, must be a device allocator |
Returns
| Type | Description |
|---|---|
| OrtLoraAdapter | New instance of LoraAdapter |
ReleaseHandle()
Overrides SafeHandle.ReleaseHandle() to properly dispose of the native instance of OrtLoraAdapter
Declaration
protected override bool ReleaseHandle()
Returns
| Type | Description |
|---|---|
| bool | always returns true |