程序包 ai.onnxruntime

类 OrtLoraAdapter

  • 所有已实现的接口
    java.lang.AutoCloseable

    public final class OrtLoraAdapter
    extends java.lang.Object
    implements java.lang.AutoCloseable
    适配器的容器,可提供给 OrtSession.RunOptions.addActiveLoraAdapter(OrtLoraAdapter),用于将适配器应用于模型的特定执行。
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      限定符和类型 方法 描述
      void close()  
      static OrtLoraAdapter create​(byte[] loraArray)
      通过字节数组创建 OrtLoraAdapter 实例。
      static OrtLoraAdapter create​(java.lang.String adapterPath)
      创建 OrtLoraAdapter 实例。
      static OrtLoraAdapter create​(java.nio.ByteBuffer loraBuffer)
      通过直接 ByteBuffer 创建 OrtLoraAdapter 实例。
      • 从类 java.lang.Object 继承的方法

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细信息

      • create

        public static OrtLoraAdapter create​(byte[] loraArray)
                                     throws OrtException
        通过字节数组创建 OrtLoraAdapter 实例。
        参数
        loraArray - 存储在字节数组中的 LoRA。
        返回值
        OrtLoraAdapter 实例。
        抛出
        OrtException - 如果原生调用失败。
      • create

        public static OrtLoraAdapter create​(java.nio.ByteBuffer loraBuffer)
                                     throws OrtException
        通过直接 ByteBuffer 创建 OrtLoraAdapter 实例。
        参数
        loraBuffer - 要加载的缓冲区。
        返回值
        OrtLoraAdapter 实例。
        抛出
        OrtException - 如果原生调用失败。
      • create

        public static OrtLoraAdapter create​(java.lang.String adapterPath)
                                     throws OrtException
        创建 OrtLoraAdapter 实例。
        参数
        adapterPath - 将被内存映射的适配器文件路径。
        返回值
        OrtLoraAdapter 实例。
        抛出
        OrtException - 如果原生调用失败。
      • close

        public void close()
        指定者
        接口 java.lang.AutoCloseable 中的 close