CreateLoraAdapter property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<Char> adapter_file_path, Pointer<OrtAllocator> allocator, Pointer<Pointer<OrtLoraAdapter>> out)>> CreateLoraAdapter
getter/setter pair

\brief Create an OrtLoraAdapter

The function attempts to locate file specified by adapter_file_path, read it and create an OrtLoraAdapter instance. The adapter_file_path should be a valid path to a file that contains a valid Lora Adapter format. The function attempts to validate the format at load time. The file will always be memory mapped, unless the platform does not support memory mapping, in which case the file will be read into memory.

\paramin adapter_file_path adapter file path. \paramin allocator optional pointer to a device allocator. If specified data is copied to the device at some point before Run() is invoked. If nullptr, data stays on CPU. The data would still be copied to device if required by the model at inference time. \paramout out A pointer to a newly created OrtLoraAdapter instance. Must be released with OrtApi::ReleaseLoraAdapter.

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.20.

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<ffi.Char> adapter_file_path,
      ffi.Pointer<OrtAllocator> allocator,
      ffi.Pointer<ffi.Pointer<OrtLoraAdapter>> out,
    )
  >
>
CreateLoraAdapter;