ONNX Runtime
Loading...
Searching...
No Matches
Ort::LoraAdapter Struct Reference

LoraAdapter holds a set of Lora Parameters loaded from a single file. More...

#include <onnxruntime_cxx_api.h>

Inheritance diagram for Ort::LoraAdapter:
Ort::detail::Base< OrtLoraAdapter >

Public Types

using Base = detail::Base< OrtLoraAdapter >
 
- Public Types inherited from Ort::detail::Base< OrtLoraAdapter >
using contained_type = OrtLoraAdapter
 

Public Member Functions

 LoraAdapter (std::nullptr_t)
 
- Public Member Functions inherited from Ort::detail::Base< OrtLoraAdapter >
constexpr Base ()=default
 
constexpr Base (contained_type *p) noexcept
 
 Base (const Base &)=delete
 
 Base (Base &&v) noexcept
 
 ~Base ()
 
Baseoperator= (const Base &)=delete
 
Baseoperator= (Base &&v) noexcept
 
constexpr operator contained_type * () const noexcept
 
contained_typerelease ()
 Relinquishes ownership of the contained C object pointer The underlying object is not destroyed.
 

Static Public Member Functions

static LoraAdapter CreateLoraAdapter (const std::basic_string< char > &adapter_path, OrtAllocator *allocator)
 Wraps OrtApi::CreateLoraAdapter.
 
static LoraAdapter CreateLoraAdapterFromArray (const void *bytes, size_t num_bytes, OrtAllocator *allocator)
 Wraps OrtApi::CreateLoraAdapterFromArray.
 

Additional Inherited Members

- Protected Attributes inherited from Ort::detail::Base< OrtLoraAdapter >
contained_typep_
 

Detailed Description

LoraAdapter holds a set of Lora Parameters loaded from a single file.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ LoraAdapter()

Ort::LoraAdapter::LoraAdapter ( std::nullptr_t  )
inlineexplicit

Create an empty LoraAdapter object, must be assigned a valid one to be used

Member Function Documentation

◆ CreateLoraAdapter()

static LoraAdapter Ort::LoraAdapter::CreateLoraAdapter ( const std::basic_string< char > &  adapter_path,
OrtAllocator allocator 
)
static

Wraps OrtApi::CreateLoraAdapter.

The function attempts to load the adapter from the specified file

Parameters
adapter_pathThe path to the Lora adapter
allocatoroptional pointer to a device allocator. If nullptr, the data stays on CPU. It would still be copied to device if required by the model at inference time.

◆ CreateLoraAdapterFromArray()

static LoraAdapter Ort::LoraAdapter::CreateLoraAdapterFromArray ( const void *  bytes,
size_t  num_bytes,
OrtAllocator allocator 
)
static

Wraps OrtApi::CreateLoraAdapterFromArray.

The function attempts to load the adapter from the specified byte array.

Parameters
bytesThe byte array containing file LoraAdapter format
num_bytesThe number of bytes in the byte array
allocatoroptional pointer to a device allocator. If nullptr, the data stays on CPU. It would still be copied to device if required by the model at inference time.