Packages

class AutoGGUFEmbeddings extends AnnotatorModel[AutoGGUFEmbeddings] with HasBatchedAnnotate[AutoGGUFEmbeddings] with HasEngine with HasLlamaCppModelProperties with HasProtectedParams

Annotator that uses the llama.cpp library to generate text embeddings with large language models.

The type of embedding pooling can be set with the setPoolingType method. The default is "MEAN". The available options are "MEAN", "CLS", and "LAST".

For all settable parameters, and their explanations, see HasLlamaCppModelProperties.

Pretrained models can be loaded with pretrained of the companion object:

val autoGGUFModel = AutoGGUFEmbeddings.pretrained()
  .setInputCols("document")
  .setOutputCol("embeddings")

The default model is "Qwen3_Embedding_0.6B_Q8_0_gguf", if no name is provided.

For available pretrained models please see the Models Hub.

For extended examples of usage, see the AutoGGUFEmbeddingsTest and the example notebook.

Note

To use GPU inference with this annotator, make sure to use the Spark NLP GPU package and set the number of GPU layers with the setNGpuLayers method.

When using larger models, we recommend adjusting GPU usage with setNCtx and setNGpuLayers according to your hardware to avoid out-of-memory errors.

Example

import com.johnsnowlabs.nlp.base._
import com.johnsnowlabs.nlp.annotator._
import org.apache.spark.ml.Pipeline
import spark.implicits._

val document = new DocumentAssembler().setInputCol("text").setOutputCol("document")

val autoGGUFModel = AutoGGUFEmbeddings
  .pretrained()
  .setInputCols("document")
  .setOutputCol("embeddings")
  .setBatchSize(4)
  .setPoolingType("MEAN")

val pipeline = new Pipeline().setStages(Array(document, autoGGUFModel))

val data = Seq(
  "The moons of Jupiter are 77 in total, with 79 confirmed natural satellites and 2 man-made ones.")
  .toDF("text")
val result = pipeline.fit(data).transform(data)
result.select("embeddings.embeddings").show(truncate = false)
+--------------------------------------------------------------------------------+
|                                                                      embeddings|
+--------------------------------------------------------------------------------+
|[[-0.034486726, 0.07770534, -0.15982522, -0.017873349, 0.013914132, 0.0365736...|
+--------------------------------------------------------------------------------+
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. AutoGGUFEmbeddings
  2. HasProtectedParams
  3. HasLlamaCppModelProperties
  4. HasEngine
  5. HasBatchedAnnotate
  6. AnnotatorModel
  7. CanBeLazy
  8. RawAnnotator
  9. HasOutputAnnotationCol
  10. HasInputAnnotationCols
  11. HasOutputAnnotatorType
  12. ParamsAndFeaturesWritable
  13. HasFeatures
  14. DefaultParamsWritable
  15. MLWritable
  16. Model
  17. Transformer
  18. PipelineStage
  19. Logging
  20. Params
  21. Serializable
  22. Serializable
  23. Identifiable
  24. AnyRef
  25. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AutoGGUFEmbeddings()

    Annotator reference id.

    Annotator reference id. Used to identify elements in metadata or to refer to this annotator type

  2. new AutoGGUFEmbeddings(uid: String)

    uid

    required uid for storing annotator to disk

Type Members

  1. implicit class ProtectedParam[T] extends Param[T]
    Definition Classes
    HasProtectedParams
  2. type AnnotationContent = Seq[Row]

    internal types to show Rows as a relevant StructType Should be deleted once Spark releases UserDefinedTypes to @developerAPI

    internal types to show Rows as a relevant StructType Should be deleted once Spark releases UserDefinedTypes to @developerAPI

    Attributes
    protected
    Definition Classes
    AnnotatorModel
  3. type AnnotatorType = String
    Definition Classes
    HasOutputAnnotatorType

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def $[T](param: Param[T]): T
    Attributes
    protected
    Definition Classes
    Params
  4. def $$[T](feature: StructFeature[T]): T
    Attributes
    protected
    Definition Classes
    HasFeatures
  5. def $$[K, V](feature: MapFeature[K, V]): Map[K, V]
    Attributes
    protected
    Definition Classes
    HasFeatures
  6. def $$[T](feature: SetFeature[T]): Set[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  7. def $$[T](feature: ArrayFeature[T]): Array[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  8. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def _transform(dataset: Dataset[_], recursivePipeline: Option[PipelineModel]): DataFrame
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  10. def afterAnnotate(dataset: DataFrame): DataFrame
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def batchAnnotate(batchedAnnotations: Seq[Array[Annotation]]): Seq[Seq[Annotation]]

    Completes the batch of annotations.

    Completes the batch of annotations.

    batchedAnnotations

    Annotations (single element arrays) in batches

    returns

    Completed text sequences

    Definition Classes
    AutoGGUFEmbeddingsHasBatchedAnnotate
  13. def batchProcess(rows: Iterator[_]): Iterator[Row]
    Definition Classes
    HasBatchedAnnotate
  14. val batchSize: IntParam

    Size of every batch (Default depends on model).

    Size of every batch (Default depends on model).

    Definition Classes
    HasBatchedAnnotate
  15. def beforeAnnotate(dataset: Dataset[_]): Dataset[_]
    Attributes
    protected
    Definition Classes
    AnnotatorModel
  16. val chatTemplate: Param[String]

    Definition Classes
    HasLlamaCppModelProperties
  17. final def checkSchema(schema: StructType, inputAnnotatorType: String): Boolean
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  18. final def clear(param: Param[_]): AutoGGUFEmbeddings.this.type
    Definition Classes
    Params
  19. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  20. def copy(extra: ParamMap): AutoGGUFEmbeddings

    requirement for annotators copies

    requirement for annotators copies

    Definition Classes
    RawAnnotator → Model → Transformer → PipelineStage → Params
  21. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  22. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  23. val defragmentationThreshold: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  24. val disableLog: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  25. val engine: Param[String]

    This param is set internally once via loadSavedModel.

    This param is set internally once via loadSavedModel. That's why there is no setter

    Definition Classes
    HasEngine
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  28. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  29. def explainParams(): String
    Definition Classes
    Params
  30. def extraValidate(structType: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  31. def extraValidateMsg: String

    Override for additional custom schema checks

    Override for additional custom schema checks

    Attributes
    protected
    Definition Classes
    RawAnnotator
  32. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  33. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  34. val features: ArrayBuffer[Feature[_, _, _]]
    Definition Classes
    HasFeatures
  35. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  36. val flashAttention: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  37. def get[T](feature: StructFeature[T]): Option[T]
    Attributes
    protected
    Definition Classes
    HasFeatures
  38. def get[K, V](feature: MapFeature[K, V]): Option[Map[K, V]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  39. def get[T](feature: SetFeature[T]): Option[Set[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  40. def get[T](feature: ArrayFeature[T]): Option[Array[T]]
    Attributes
    protected
    Definition Classes
    HasFeatures
  41. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  42. def getBatchSize: Int

    Size of every batch.

    Size of every batch.

    Definition Classes
    HasBatchedAnnotate
  43. def getChatTemplate: String

    Definition Classes
    HasLlamaCppModelProperties
  44. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  45. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  46. def getDefragmentationThreshold: Float

    Definition Classes
    HasLlamaCppModelProperties
  47. def getDisableLog: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  48. def getEngine: String

    Definition Classes
    HasEngine
  49. def getFlashAttention: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  50. def getInputCols: Array[String]

    returns

    input annotations columns currently used

    Definition Classes
    HasInputAnnotationCols
  51. def getLazyAnnotator: Boolean
    Definition Classes
    CanBeLazy
  52. def getLogVerbosity: Int
    Definition Classes
    HasLlamaCppModelProperties
  53. def getMainGpu: Int

    Definition Classes
    HasLlamaCppModelProperties
  54. def getMetadata: String

    Get the metadata for the model

    Get the metadata for the model

    Definition Classes
    HasLlamaCppModelProperties
  55. def getMetadataMap: Map[String, Map[String, String]]
    Definition Classes
    HasLlamaCppModelProperties
  56. def getModelDraft: String

    Definition Classes
    HasLlamaCppModelProperties
  57. def getModelIfNotSet: GGUFWrapper

  58. def getModelParameters: ModelParameters
    Attributes
    protected
    Definition Classes
    HasLlamaCppModelProperties
  59. def getNBatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  60. def getNCtx: Int

    Definition Classes
    HasLlamaCppModelProperties
  61. def getNDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  62. def getNGpuLayers: Int

    Definition Classes
    HasLlamaCppModelProperties
  63. def getNGpuLayersDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  64. def getNThreads: Int

    Definition Classes
    HasLlamaCppModelProperties
  65. def getNThreadsBatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  66. def getNUbatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  67. def getNoKvOffload: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  68. def getNuma: String

    Definition Classes
    HasLlamaCppModelProperties
  69. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  70. final def getOutputCol: String

    Gets annotation column name going to generate

    Gets annotation column name going to generate

    Definition Classes
    HasOutputAnnotationCol
  71. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  72. def getPoolingType: String

  73. def getRopeFreqBase: Float

    Definition Classes
    HasLlamaCppModelProperties
  74. def getRopeFreqScale: Float

    Definition Classes
    HasLlamaCppModelProperties
  75. def getRopeScalingType: String

    Definition Classes
    HasLlamaCppModelProperties
  76. def getSplitMode: String

    Definition Classes
    HasLlamaCppModelProperties
  77. def getSystemPrompt: String

    Definition Classes
    HasLlamaCppModelProperties
  78. def getUseMlock: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  79. def getUseMmap: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  80. def getYarnAttnFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  81. def getYarnBetaFast: Float

    Definition Classes
    HasLlamaCppModelProperties
  82. def getYarnBetaSlow: Float

    Definition Classes
    HasLlamaCppModelProperties
  83. def getYarnExtFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  84. def getYarnOrigCtx: Int

    Definition Classes
    HasLlamaCppModelProperties
  85. val gpuSplitMode: Param[String]

    Set how to split the model across GPUs

    Set how to split the model across GPUs

    • NONE: No GPU split
    • LAYER: Split the model across GPUs by layer
    • ROW: Split the model across GPUs by rows
    Definition Classes
    HasLlamaCppModelProperties
  86. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  87. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  88. def hasParent: Boolean
    Definition Classes
    Model
  89. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  90. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  91. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  92. val inputAnnotatorTypes: Array[AnnotatorType]

    Annotator reference id.

    Annotator reference id. Used to identify elements in metadata or to refer to this annotator type

    Definition Classes
    AutoGGUFEmbeddingsHasInputAnnotationCols
  93. final val inputCols: StringArrayParam

    columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified

    columns that contain annotations necessary to run this annotator AnnotatorType is used both as input and output columns if not specified

    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  94. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  95. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  96. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  97. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  98. val lazyAnnotator: BooleanParam
    Definition Classes
    CanBeLazy
  99. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  100. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  101. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  102. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  103. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  104. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  105. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  106. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  107. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  108. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  109. val logVerbosity: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  110. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  111. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  112. val logger: Logger
    Attributes
    protected
    Definition Classes
    HasLlamaCppModelProperties
  113. val mainGpu: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  114. val metadata: ProtectedParam[String]
    Definition Classes
    HasLlamaCppModelProperties
  115. val modelDraft: Param[String]

    Definition Classes
    HasLlamaCppModelProperties
  116. def msgHelper(schema: StructType): String
    Attributes
    protected
    Definition Classes
    HasInputAnnotationCols
  117. val nBatch: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  118. val nCtx: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  119. val nDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  120. val nGpuLayers: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  121. val nGpuLayersDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  122. val nThreads: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  123. val nThreadsBatch: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  124. val nUbatch: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  125. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  126. val noKvOffload: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  127. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  128. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  129. val numaStrategy: Param[String]

    Set optimization strategies that help on some NUMA systems (if available)

    Set optimization strategies that help on some NUMA systems (if available)

    Available Strategies:

    • DISABLED: No NUMA optimizations
    • DISTRIBUTE: Spread execution evenly over all
    • ISOLATE: Only spawn threads on CPUs on the node that execution started on
    • NUMA_CTL: Use the CPU map provided by numactl
    • MIRROR: Mirrors the model across NUMA nodes
    Definition Classes
    HasLlamaCppModelProperties
  130. def onWrite(path: String, spark: SparkSession): Unit
  131. val optionalInputAnnotatorTypes: Array[String]
    Definition Classes
    HasInputAnnotationCols
  132. val outputAnnotatorType: AnnotatorType
  133. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  134. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  135. var parent: Estimator[AutoGGUFEmbeddings]
    Definition Classes
    Model
  136. val poolingType: Param[String]

    Set the pooling type for embeddings, use model default if unspecified

    Set the pooling type for embeddings, use model default if unspecified

    • MEAN: Mean Pooling
    • CLS: Choose the CLS token
    • LAST: Choose the last token
  137. val ropeFreqBase: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  138. val ropeFreqScale: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  139. val ropeScalingType: Param[String]

    Set the RoPE frequency scaling method, defaults to linear unless specified by the model.

    Set the RoPE frequency scaling method, defaults to linear unless specified by the model.

    • UNSPECIFIED: Don't use any scaling
    • LINEAR: Linear scaling
    • YARN: YaRN RoPE scaling
    Definition Classes
    HasLlamaCppModelProperties
  140. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  141. def set[T](param: ProtectedParam[T], value: T): AutoGGUFEmbeddings.this.type

    Sets the value for a protected Param.

    Sets the value for a protected Param.

    If the parameter was already set, it will not be set again. Default values do not count as a set value and can be overridden.

    T

    Type of the parameter

    param

    Protected parameter to set

    value

    Value for the parameter

    returns

    This object

    Definition Classes
    HasProtectedParams
  142. def set[T](feature: StructFeature[T], value: T): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  143. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  144. def set[T](feature: SetFeature[T], value: Set[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  145. def set[T](feature: ArrayFeature[T], value: Array[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  146. final def set(paramPair: ParamPair[_]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  147. final def set(param: String, value: Any): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  148. final def set[T](param: Param[T], value: T): AutoGGUFEmbeddings.this.type
    Definition Classes
    Params
  149. def setBatchSize(size: Int): AutoGGUFEmbeddings.this.type

    Size of every batch.

    Size of every batch.

    Definition Classes
    HasBatchedAnnotate
  150. def setChatTemplate(chatTemplate: String): AutoGGUFEmbeddings.this.type

    The chat template to use

    The chat template to use

    Definition Classes
    HasLlamaCppModelProperties
  151. def setDefault[T](feature: StructFeature[T], value: () ⇒ T): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  152. def setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  153. def setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  154. def setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  155. final def setDefault(paramPairs: ParamPair[_]*): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  156. final def setDefault[T](param: Param[T], value: T): AutoGGUFEmbeddings.this.type
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  157. def setDefragmentationThreshold(defragThold: Float): AutoGGUFEmbeddings.this.type

    Set the KV cache defragmentation threshold

    Set the KV cache defragmentation threshold

    Definition Classes
    HasLlamaCppModelProperties
  158. def setDisableLog(disableLog: Boolean): AutoGGUFEmbeddings.this.type

    Definition Classes
    HasLlamaCppModelProperties
  159. def setFlashAttention(flashAttention: Boolean): AutoGGUFEmbeddings.this.type

    Whether to enable Flash Attention

    Whether to enable Flash Attention

    Definition Classes
    HasLlamaCppModelProperties
  160. def setGpuSplitMode(splitMode: String): AutoGGUFEmbeddings.this.type

    Set how to split the model across GPUs

    Set how to split the model across GPUs

    • NONE: No GPU split -LAYER: Split the model across GPUs by layer 2. ROW: Split the model across GPUs by rows
    Definition Classes
    HasLlamaCppModelProperties
  161. final def setInputCols(value: String*): AutoGGUFEmbeddings.this.type
    Definition Classes
    HasInputAnnotationCols
  162. def setInputCols(value: Array[String]): AutoGGUFEmbeddings.this.type

    Overrides required annotators column if different than default

    Overrides required annotators column if different than default

    Definition Classes
    HasInputAnnotationCols
  163. def setLazyAnnotator(value: Boolean): AutoGGUFEmbeddings.this.type
    Definition Classes
    CanBeLazy
  164. def setLogVerbosity(logVerbosity: Int): AutoGGUFEmbeddings.this.type

    Set the verbosity threshold.

    Set the verbosity threshold. Messages with a higher verbosity will be ignored.

    Values map to the following:

    • GGML_LOG_LEVEL_NONE = 0
    • GGML_LOG_LEVEL_DEBUG = 1
    • GGML_LOG_LEVEL_INFO = 2
    • GGML_LOG_LEVEL_WARN = 3
    • GGML_LOG_LEVEL_ERROR = 4
    • GGML_LOG_LEVEL_CONT = 5 (continue previous log)
    Definition Classes
    HasLlamaCppModelProperties
  165. def setMainGpu(mainGpu: Int): AutoGGUFEmbeddings.this.type

    Set the GPU that is used for scratch and small tensors

    Set the GPU that is used for scratch and small tensors

    Definition Classes
    HasLlamaCppModelProperties
  166. def setMetadata(metadata: String): AutoGGUFEmbeddings.this.type

    Set the metadata for the model

    Set the metadata for the model

    Definition Classes
    HasLlamaCppModelProperties
  167. def setModelDraft(modelDraft: String): AutoGGUFEmbeddings.this.type

    Set the draft model for speculative decoding

    Set the draft model for speculative decoding

    Definition Classes
    HasLlamaCppModelProperties
  168. def setModelIfNotSet(spark: SparkSession, wrapper: GGUFWrapper): AutoGGUFEmbeddings.this.type

  169. def setNBatch(nBatch: Int): AutoGGUFEmbeddings.this.type

    Set the logical batch size for prompt processing (must be >=32 to use BLAS)

    Set the logical batch size for prompt processing (must be >=32 to use BLAS)

    Definition Classes
    HasLlamaCppModelProperties
  170. def setNCtx(nCtx: Int): AutoGGUFEmbeddings.this.type

    Set the size of the prompt context

    Set the size of the prompt context

    Definition Classes
    HasLlamaCppModelProperties
  171. def setNDraft(nDraft: Int): AutoGGUFEmbeddings.this.type

    Set the number of tokens to draft for speculative decoding

    Set the number of tokens to draft for speculative decoding

    Definition Classes
    HasLlamaCppModelProperties
  172. def setNGpuLayers(nGpuLayers: Int): AutoGGUFEmbeddings.this.type

    Set the number of layers to store in VRAM (-1 - use default)

    Set the number of layers to store in VRAM (-1 - use default)

    Definition Classes
    HasLlamaCppModelProperties
  173. def setNGpuLayersDraft(nGpuLayersDraft: Int): AutoGGUFEmbeddings.this.type

    Set the number of layers to store in VRAM for the draft model (-1 - use default)

    Set the number of layers to store in VRAM for the draft model (-1 - use default)

    Definition Classes
    HasLlamaCppModelProperties
  174. def setNParallel(nParallel: Int): AutoGGUFEmbeddings.this.type

    Sets the number of parallel processes for decoding.

    Sets the number of parallel processes for decoding. This is an alias for setBatchSize.

    nParallel

    The number of parallel processes for decoding

  175. def setNThreads(nThreads: Int): AutoGGUFEmbeddings.this.type

    Set the number of threads to use during generation

    Set the number of threads to use during generation

    Definition Classes
    HasLlamaCppModelProperties
  176. def setNThreadsBatch(nThreadsBatch: Int): AutoGGUFEmbeddings.this.type

    Set the number of threads to use during batch and prompt processing

    Set the number of threads to use during batch and prompt processing

    Definition Classes
    HasLlamaCppModelProperties
  177. def setNUbatch(nUbatch: Int): AutoGGUFEmbeddings.this.type

    Set the physical batch size for prompt processing (must be >=32 to use BLAS)

    Set the physical batch size for prompt processing (must be >=32 to use BLAS)

    Definition Classes
    HasLlamaCppModelProperties
  178. def setNoKvOffload(noKvOffload: Boolean): AutoGGUFEmbeddings.this.type

    Whether to disable KV offload

    Whether to disable KV offload

    Definition Classes
    HasLlamaCppModelProperties
  179. def setNumaStrategy(numa: String): AutoGGUFEmbeddings.this.type

    Set optimization strategies that help on some NUMA systems (if available)

    Set optimization strategies that help on some NUMA systems (if available)

    Available Strategies:

    • DISABLED: No NUMA optimizations
    • DISTRIBUTE: spread execution evenly over all
    • ISOLATE: only spawn threads on CPUs on the node that execution started on
    • NUMA_CTL: use the CPU map provided by numactl
    • MIRROR: Mirrors the model across NUMA nodes
    Definition Classes
    HasLlamaCppModelProperties
  180. final def setOutputCol(value: String): AutoGGUFEmbeddings.this.type

    Overrides annotation column name when transforming

    Overrides annotation column name when transforming

    Definition Classes
    HasOutputAnnotationCol
  181. def setParent(parent: Estimator[AutoGGUFEmbeddings]): AutoGGUFEmbeddings
    Definition Classes
    Model
  182. def setPoolingType(poolingType: String): AutoGGUFEmbeddings.this.type

    Set the pooling type for embeddings, use model default if unspecified.

    Set the pooling type for embeddings, use model default if unspecified.

    Possible values:

    • MEAN: Mean pooling
    • CLS: Choose the CLS token
    • LAST: Choose the last token
    • RANK: For reranking
  183. def setRopeFreqBase(ropeFreqBase: Float): AutoGGUFEmbeddings.this.type

    Set the RoPE base frequency, used by NTK-aware scaling

    Set the RoPE base frequency, used by NTK-aware scaling

    Definition Classes
    HasLlamaCppModelProperties
  184. def setRopeFreqScale(ropeFreqScale: Float): AutoGGUFEmbeddings.this.type

    Set the RoPE frequency scaling factor, expands context by a factor of 1/N

    Set the RoPE frequency scaling factor, expands context by a factor of 1/N

    Definition Classes
    HasLlamaCppModelProperties
  185. def setRopeScalingType(ropeScalingType: String): AutoGGUFEmbeddings.this.type

    Set the RoPE frequency scaling method, defaults to linear unless specified by the model.

    Set the RoPE frequency scaling method, defaults to linear unless specified by the model.

    • NONE: Don't use any scaling
    • LINEAR: Linear scaling
    • YARN: YaRN RoPE scaling
    Definition Classes
    HasLlamaCppModelProperties
  186. def setSystemPrompt(systemPrompt: String): AutoGGUFEmbeddings.this.type

    Set a system prompt to use

    Set a system prompt to use

    Definition Classes
    HasLlamaCppModelProperties
  187. def setUseMlock(useMlock: Boolean): AutoGGUFEmbeddings.this.type

    Whether to force the system to keep model in RAM rather than swapping or compressing

    Whether to force the system to keep model in RAM rather than swapping or compressing

    Definition Classes
    HasLlamaCppModelProperties
  188. def setUseMmap(useMmap: Boolean): AutoGGUFEmbeddings.this.type

    Whether to use memory-map model (faster load but may increase pageouts if not using mlock)

    Whether to use memory-map model (faster load but may increase pageouts if not using mlock)

    Definition Classes
    HasLlamaCppModelProperties
  189. def setYarnAttnFactor(yarnAttnFactor: Float): AutoGGUFEmbeddings.this.type

    Set the YaRN scale sqrt(t) or attention magnitude

    Set the YaRN scale sqrt(t) or attention magnitude

    Definition Classes
    HasLlamaCppModelProperties
  190. def setYarnBetaFast(yarnBetaFast: Float): AutoGGUFEmbeddings.this.type

    Set the YaRN low correction dim or beta

    Set the YaRN low correction dim or beta

    Definition Classes
    HasLlamaCppModelProperties
  191. def setYarnBetaSlow(yarnBetaSlow: Float): AutoGGUFEmbeddings.this.type

    Set the YaRN high correction dim or alpha

    Set the YaRN high correction dim or alpha

    Definition Classes
    HasLlamaCppModelProperties
  192. def setYarnExtFactor(yarnExtFactor: Float): AutoGGUFEmbeddings.this.type

    Set the YaRN extrapolation mix factor

    Set the YaRN extrapolation mix factor

    Definition Classes
    HasLlamaCppModelProperties
  193. def setYarnOrigCtx(yarnOrigCtx: Int): AutoGGUFEmbeddings.this.type

    Set the YaRN original context size of model

    Set the YaRN original context size of model

    Definition Classes
    HasLlamaCppModelProperties
  194. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  195. val systemPrompt: Param[String]

    Definition Classes
    HasLlamaCppModelProperties
  196. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  197. final def transform(dataset: Dataset[_]): DataFrame

    Given requirements are met, this applies ML transformation within a Pipeline or stand-alone Output annotation will be generated as a new column, previous annotations are still available separately metadata is built at schema level to record annotations structural information outside its content

    Given requirements are met, this applies ML transformation within a Pipeline or stand-alone Output annotation will be generated as a new column, previous annotations are still available separately metadata is built at schema level to record annotations structural information outside its content

    dataset

    Dataset[Row]

    Definition Classes
    AnnotatorModel → Transformer
  198. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  199. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  200. final def transformSchema(schema: StructType): StructType

    requirement for pipeline transformation validation.

    requirement for pipeline transformation validation. It is called on fit()

    Definition Classes
    RawAnnotator → PipelineStage
  201. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  202. val uid: String
    Definition Classes
    AutoGGUFEmbeddings → Identifiable
  203. val useMlock: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  204. val useMmap: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  205. def validate(schema: StructType): Boolean

    takes a Dataset and checks to see if all the required annotation types are present.

    takes a Dataset and checks to see if all the required annotation types are present.

    schema

    to be validated

    returns

    True if all the required types are present, else false

    Attributes
    protected
    Definition Classes
    RawAnnotator
  206. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  207. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  208. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  209. def wrapColumnMetadata(col: Column): Column
    Attributes
    protected
    Definition Classes
    RawAnnotator
  210. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  211. val yarnAttnFactor: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  212. val yarnBetaFast: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  213. val yarnBetaSlow: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  214. val yarnExtFactor: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  215. val yarnOrigCtx: IntParam

    Definition Classes
    HasLlamaCppModelProperties

Inherited from HasProtectedParams

Inherited from HasEngine

Inherited from CanBeLazy

Inherited from HasOutputAnnotationCol

Inherited from HasInputAnnotationCols

Inherited from HasOutputAnnotatorType

Inherited from ParamsAndFeaturesWritable

Inherited from HasFeatures

Inherited from DefaultParamsWritable

Inherited from MLWritable

Inherited from Model[AutoGGUFEmbeddings]

Inherited from Transformer

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Parameters

A list of (hyper-)parameter keys this annotator can take. Users can set and get the parameter values through setters and getters, respectively.

Members

Parameter setters

Parameter getters