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 close(): Unit

    Closes the llama.cpp model backend freeing resources.

    Closes the llama.cpp model backend freeing resources. The model is reloaded when used again.

  21. def copy(extra: ParamMap): AutoGGUFEmbeddings

    requirement for annotators copies

    requirement for annotators copies

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

    Definition Classes
    HasLlamaCppModelProperties
  25. val disableLog: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  26. 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
  27. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  29. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  30. def explainParams(): String
    Definition Classes
    Params
  31. def extraValidate(structType: StructType): Boolean
    Attributes
    protected
    Definition Classes
    RawAnnotator
  32. def extraValidateMsg: String

    Override for additional custom schema checks

    Override for additional custom schema checks

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

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

    Size of every batch.

    Size of every batch.

    Definition Classes
    HasBatchedAnnotate
  44. def getChatTemplate: String

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

    Definition Classes
    HasLlamaCppModelProperties
  48. def getDisableLog: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  49. def getEngine: String

    Definition Classes
    HasEngine
  50. def getFlashAttention: Boolean

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

    returns

    input annotations columns currently used

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

    Definition Classes
    HasLlamaCppModelProperties
  55. def getMetadata: String

    Get the metadata for the model

    Get the metadata for the model

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

    Definition Classes
    HasLlamaCppModelProperties
  58. def getModelIfNotSet: GGUFWrapper

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

    Definition Classes
    HasLlamaCppModelProperties
  61. def getNCtx: Int

    Definition Classes
    HasLlamaCppModelProperties
  62. def getNDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  63. def getNGpuLayers: Int

    Definition Classes
    HasLlamaCppModelProperties
  64. def getNGpuLayersDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  65. def getNThreads: Int

    Definition Classes
    HasLlamaCppModelProperties
  66. def getNThreadsBatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  67. def getNUbatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  68. def getNoKvOffload: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  69. def getNuma: String

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

    Gets annotation column name going to generate

    Gets annotation column name going to generate

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

  74. def getReasoningBudget: Int

    Definition Classes
    HasLlamaCppModelProperties
  75. def getRopeFreqBase: Float

    Definition Classes
    HasLlamaCppModelProperties
  76. def getRopeFreqScale: Float

    Definition Classes
    HasLlamaCppModelProperties
  77. def getRopeScalingType: String

    Definition Classes
    HasLlamaCppModelProperties
  78. def getSplitMode: String

    Definition Classes
    HasLlamaCppModelProperties
  79. def getSystemPrompt: String

    Definition Classes
    HasLlamaCppModelProperties
  80. def getUseMlock: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  81. def getUseMmap: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  82. def getYarnAttnFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  83. def getYarnBetaFast: Float

    Definition Classes
    HasLlamaCppModelProperties
  84. def getYarnBetaSlow: Float

    Definition Classes
    HasLlamaCppModelProperties
  85. def getYarnExtFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  86. def getYarnOrigCtx: Int

    Definition Classes
    HasLlamaCppModelProperties
  87. 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
  88. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  89. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  90. def hasParent: Boolean
    Definition Classes
    Model
  91. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  92. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  93. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  94. 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
  95. 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
  96. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  97. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  98. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  99. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  100. val lazyAnnotator: BooleanParam
    Definition Classes
    CanBeLazy
  101. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  102. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  103. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  104. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  105. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  106. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  107. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  108. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  109. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  110. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  111. val logVerbosity: IntParam

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

    Definition Classes
    HasLlamaCppModelProperties
  116. val metadata: ProtectedParam[String]
    Definition Classes
    HasLlamaCppModelProperties
  117. val modelDraft: Param[String]

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

    Definition Classes
    HasLlamaCppModelProperties
  120. val nCtx: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  121. val nDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  122. val nGpuLayers: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  123. val nGpuLayersDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  124. val nThreads: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  125. val nThreadsBatch: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  126. val nUbatch: IntParam

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

    Definition Classes
    HasLlamaCppModelProperties
  129. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  130. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  131. 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
  132. def onWrite(path: String, spark: SparkSession): Unit
  133. val optionalInputAnnotatorTypes: Array[String]
    Definition Classes
    HasInputAnnotationCols
  134. val outputAnnotatorType: AnnotatorType
  135. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  136. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  137. var parent: Estimator[AutoGGUFEmbeddings]
    Definition Classes
    Model
  138. 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
  139. val reasoningBudget: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  140. val ropeFreqBase: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  141. val ropeFreqScale: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  142. 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
  143. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  144. 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
  145. def set[T](feature: StructFeature[T], value: T): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  146. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  147. def set[T](feature: SetFeature[T], value: Set[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  148. def set[T](feature: ArrayFeature[T], value: Array[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  149. final def set(paramPair: ParamPair[_]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  150. final def set(param: String, value: Any): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  151. final def set[T](param: Param[T], value: T): AutoGGUFEmbeddings.this.type
    Definition Classes
    Params
  152. def setBatchSize(size: Int): AutoGGUFEmbeddings.this.type

    Size of every batch.

    Size of every batch.

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

    The chat template to use

    The chat template to use

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

    Set the KV cache defragmentation threshold

    Set the KV cache defragmentation threshold

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

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

    Whether to enable Flash Attention

    Whether to enable Flash Attention

    Definition Classes
    HasLlamaCppModelProperties
  163. 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
  164. final def setInputCols(value: String*): AutoGGUFEmbeddings.this.type
    Definition Classes
    HasInputAnnotationCols
  165. 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
  166. def setLazyAnnotator(value: Boolean): AutoGGUFEmbeddings.this.type
    Definition Classes
    CanBeLazy
  167. 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
  168. 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
  169. def setMetadata(metadata: String): AutoGGUFEmbeddings.this.type

    Set the metadata for the model

    Set the metadata for the model

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

    Set the draft model for speculative decoding

    Set the draft model for speculative decoding

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

  172. 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
  173. def setNCtx(nCtx: Int): AutoGGUFEmbeddings.this.type

    Set the size of the prompt context

    Set the size of the prompt context

    Definition Classes
    HasLlamaCppModelProperties
  174. 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
  175. 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
  176. 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
  177. 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

  178. 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
  179. 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
  180. 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
  181. def setNoKvOffload(noKvOffload: Boolean): AutoGGUFEmbeddings.this.type

    Whether to disable KV offload

    Whether to disable KV offload

    Definition Classes
    HasLlamaCppModelProperties
  182. 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
  183. final def setOutputCol(value: String): AutoGGUFEmbeddings.this.type

    Overrides annotation column name when transforming

    Overrides annotation column name when transforming

    Definition Classes
    HasOutputAnnotationCol
  184. def setParent(parent: Estimator[AutoGGUFEmbeddings]): AutoGGUFEmbeddings
    Definition Classes
    Model
  185. 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
  186. def setReasoningBudget(reasoningBudget: Int): AutoGGUFEmbeddings.this.type

    Controls the amount of thinking allowed; currently only one of: -1 for unrestricted thinking budget, or 0 to disable thinking (default: -1)

    Controls the amount of thinking allowed; currently only one of: -1 for unrestricted thinking budget, or 0 to disable thinking (default: -1)

    Definition Classes
    HasLlamaCppModelProperties
  187. 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
  188. 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
  189. 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
  190. def setSystemPrompt(systemPrompt: String): AutoGGUFEmbeddings.this.type

    Set a system prompt to use

    Set a system prompt to use

    Definition Classes
    HasLlamaCppModelProperties
  191. 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
  192. 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
  193. 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
  194. 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
  195. 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
  196. def setYarnExtFactor(yarnExtFactor: Float): AutoGGUFEmbeddings.this.type

    Set the YaRN extrapolation mix factor

    Set the YaRN extrapolation mix factor

    Definition Classes
    HasLlamaCppModelProperties
  197. 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
  198. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  199. val systemPrompt: Param[String]

    Definition Classes
    HasLlamaCppModelProperties
  200. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  201. 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
  202. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  203. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  204. 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
  205. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  206. val uid: String
    Definition Classes
    AutoGGUFEmbeddings → Identifiable
  207. val useMlock: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  208. val useMmap: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  209. 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
  210. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  211. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  212. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  213. def wrapColumnMetadata(col: Column): Column
    Attributes
    protected
    Definition Classes
    RawAnnotator
  214. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  215. val yarnAttnFactor: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  216. val yarnBetaFast: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  217. val yarnBetaSlow: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  218. val yarnExtFactor: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  219. 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