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 "NONE", "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 "nomic-embed-text-v1.5.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 defaultGpuLayers: Int
    Attributes
    protected
    Definition Classes
    HasLlamaCppModelProperties
  24. val defaultMainGpu: Int
    Attributes
    protected
    Definition Classes
    HasLlamaCppModelProperties
  25. val defragmentationThreshold: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  26. val embedding: BooleanParam

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

    Override for additional custom schema checks

    Override for additional custom schema checks

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

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

    Size of every batch.

    Size of every batch.

    Definition Classes
    HasBatchedAnnotate
  45. def getChatTemplate: String

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

    Definition Classes
    HasLlamaCppModelProperties
  49. def getEmbedding: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  50. def getEngine: String

    Definition Classes
    HasEngine
  51. def getFlashAttention: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  52. def getGrpAttnN: Int
    Definition Classes
    HasLlamaCppModelProperties
  53. def getGrpAttnW: Int

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

    returns

    input annotations columns currently used

    Definition Classes
    HasInputAnnotationCols
  55. def getInputPrefixBos: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  56. def getLazyAnnotator: Boolean
    Definition Classes
    CanBeLazy
  57. def getLookupCacheDynamicFilePath: String

    Definition Classes
    HasLlamaCppModelProperties
  58. def getLookupCacheStaticFilePath: String

    Definition Classes
    HasLlamaCppModelProperties
  59. def getLoraAdapters: Map[String, Float]

    Definition Classes
    HasLlamaCppModelProperties
  60. def getMainGpu: Int

    Definition Classes
    HasLlamaCppModelProperties
  61. def getMetadata: String

    Get the metadata for the model

    Get the metadata for the model

    Definition Classes
    HasLlamaCppModelProperties
  62. def getMetadataMap: Map[String, String]
    Definition Classes
    HasLlamaCppModelProperties
  63. def getModelDraft: String

    Definition Classes
    HasLlamaCppModelProperties
  64. def getModelIfNotSet: GGUFWrapper

  65. def getModelParameters: ModelParameters
    Attributes
    protected
    Definition Classes
    HasLlamaCppModelProperties
  66. def getNBatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  67. def getNChunks: Int

    Definition Classes
    HasLlamaCppModelProperties
  68. def getNCtx: Int

    Definition Classes
    HasLlamaCppModelProperties
  69. def getNDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  70. def getNGpuLayers: Int

    Definition Classes
    HasLlamaCppModelProperties
  71. def getNGpuLayersDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  72. def getNSequences: Int

    Definition Classes
    HasLlamaCppModelProperties
  73. def getNThreads: Int

    Definition Classes
    HasLlamaCppModelProperties
  74. def getNThreadsBatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  75. def getNThreadsBatchDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  76. def getNThreadsDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  77. def getNUbatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  78. def getNoKvOffload: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  79. def getNuma: String

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

    Gets annotation column name going to generate

    Gets annotation column name going to generate

    Definition Classes
    HasOutputAnnotationCol
  82. def getPSplit: Float

    Definition Classes
    HasLlamaCppModelProperties
  83. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  84. def getPoolingType: String

    Definition Classes
    HasLlamaCppModelProperties
  85. def getRopeFreqBase: Float

    Definition Classes
    HasLlamaCppModelProperties
  86. def getRopeFreqScale: Float

    Definition Classes
    HasLlamaCppModelProperties
  87. def getRopeScalingType: String

    Definition Classes
    HasLlamaCppModelProperties
  88. def getSplitMode: String

    Definition Classes
    HasLlamaCppModelProperties
  89. def getSystemPrompt: String

    Definition Classes
    HasLlamaCppModelProperties
  90. def getTensorSplit: Array[Double]

    Definition Classes
    HasLlamaCppModelProperties
  91. def getUseMlock: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  92. def getUseMmap: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  93. def getYarnAttnFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  94. def getYarnBetaFast: Float

    Definition Classes
    HasLlamaCppModelProperties
  95. def getYarnBetaSlow: Float

    Definition Classes
    HasLlamaCppModelProperties
  96. def getYarnExtFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  97. def getYarnOrigCtx: Int

    Definition Classes
    HasLlamaCppModelProperties
  98. 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
  99. val grpAttnN: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  100. val grpAttnW: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  101. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  102. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  103. def hasParent: Boolean
    Definition Classes
    Model
  104. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  105. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  106. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  107. 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
  108. 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
  109. val inputPrefixBos: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  110. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  111. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  112. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  113. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  114. val lazyAnnotator: BooleanParam
    Definition Classes
    CanBeLazy
  115. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  116. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  117. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  118. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  119. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  120. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  121. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  122. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  123. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  124. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  125. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  126. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  127. val logger: Logger
    Attributes
    protected
    Definition Classes
    HasLlamaCppModelProperties
  128. val lookupCacheDynamicFilePath: Param[String]

    Definition Classes
    HasLlamaCppModelProperties
  129. val lookupCacheStaticFilePath: Param[String]

    Definition Classes
    HasLlamaCppModelProperties
  130. val loraAdapters: StructFeature[Map[String, Float]]

    Definition Classes
    HasLlamaCppModelProperties
  131. val mainGpu: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  132. val metadata: ProtectedParam[String]
    Definition Classes
    HasLlamaCppModelProperties
  133. val modelDraft: Param[String]

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

    Definition Classes
    HasLlamaCppModelProperties
  136. val nChunks: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  137. val nCtx: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  138. val nDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  139. val nGpuLayers: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  140. val nGpuLayersDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  141. val nSequences: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  142. val nThreads: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  143. val nThreadsBatch: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  144. val nThreadsBatchDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  145. val nThreadsDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  146. val nUbatch: IntParam

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

    Definition Classes
    HasLlamaCppModelProperties
  149. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  150. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  151. 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
  152. def onWrite(path: String, spark: SparkSession): Unit
  153. val optionalInputAnnotatorTypes: Array[String]
    Definition Classes
    HasInputAnnotationCols
  154. val outputAnnotatorType: AnnotatorType
  155. final val outputCol: Param[String]
    Attributes
    protected
    Definition Classes
    HasOutputAnnotationCol
  156. val pSplit: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  157. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  158. var parent: Estimator[AutoGGUFEmbeddings]
    Definition Classes
    Model
  159. 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

    • 0 NONE: Don't use any pooling
    • 1 MEAN: Mean Pooling
    • 2 CLS: Choose the CLS token
    • 3 LAST: Choose the last token
    Definition Classes
    HasLlamaCppModelProperties
  160. val ropeFreqBase: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  161. val ropeFreqScale: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  162. 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
  163. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  164. 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
  165. def set[T](feature: StructFeature[T], value: T): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  166. def set[K, V](feature: MapFeature[K, V], value: Map[K, V]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  167. def set[T](feature: SetFeature[T], value: Set[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  168. def set[T](feature: ArrayFeature[T], value: Array[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  169. final def set(paramPair: ParamPair[_]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  170. final def set(param: String, value: Any): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  171. final def set[T](param: Param[T], value: T): AutoGGUFEmbeddings.this.type
    Definition Classes
    Params
  172. def setBatchSize(size: Int): AutoGGUFEmbeddings.this.type

    Size of every batch.

    Size of every batch.

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

    The chat template to use

    The chat template to use

    Definition Classes
    HasLlamaCppModelProperties
  174. def setDefault[T](feature: StructFeature[T], value: () ⇒ T): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  175. def setDefault[K, V](feature: MapFeature[K, V], value: () ⇒ Map[K, V]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  176. def setDefault[T](feature: SetFeature[T], value: () ⇒ Set[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  177. def setDefault[T](feature: ArrayFeature[T], value: () ⇒ Array[T]): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasFeatures
  178. final def setDefault(paramPairs: ParamPair[_]*): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    Params
  179. final def setDefault[T](param: Param[T], value: T): AutoGGUFEmbeddings.this.type
    Attributes
    protected[org.apache.spark.ml]
    Definition Classes
    Params
  180. def setDefragmentationThreshold(defragThold: Float): AutoGGUFEmbeddings.this.type

    Set the KV cache defragmentation threshold

    Set the KV cache defragmentation threshold

    Definition Classes
    HasLlamaCppModelProperties
  181. def setEmbedding(embedding: Boolean): AutoGGUFEmbeddings.this.type

    Whether to load model with embedding support

    Whether to load model with embedding support

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

    Whether to enable Flash Attention

    Whether to enable Flash Attention

    Definition Classes
    HasLlamaCppModelProperties
  183. 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
  184. def setGpuSupportIfAvailable(spark: SparkSession): AutoGGUFEmbeddings.this.type
    Attributes
    protected
    Definition Classes
    HasLlamaCppModelProperties
  185. def setGrpAttnN(grpAttnN: Int): AutoGGUFEmbeddings.this.type

    Set the group-attention factor

    Set the group-attention factor

    Definition Classes
    HasLlamaCppModelProperties
  186. def setGrpAttnW(grpAttnW: Int): AutoGGUFEmbeddings.this.type

    Set the group-attention width

    Set the group-attention width

    Definition Classes
    HasLlamaCppModelProperties
  187. final def setInputCols(value: String*): AutoGGUFEmbeddings.this.type
    Definition Classes
    HasInputAnnotationCols
  188. 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
  189. def setInputPrefixBos(inputPrefixBos: Boolean): AutoGGUFEmbeddings.this.type

    Whether to add prefix BOS to user inputs, preceding the --in-prefix string

    Whether to add prefix BOS to user inputs, preceding the --in-prefix string

    Definition Classes
    HasLlamaCppModelProperties
  190. def setLazyAnnotator(value: Boolean): AutoGGUFEmbeddings.this.type
    Definition Classes
    CanBeLazy
  191. def setLookupCacheDynamicFilePath(lookupCacheDynamicFilePath: String): AutoGGUFEmbeddings.this.type

    Set path to dynamic lookup cache to use for lookup decoding (updated by generation)

    Set path to dynamic lookup cache to use for lookup decoding (updated by generation)

    Definition Classes
    HasLlamaCppModelProperties
  192. def setLookupCacheStaticFilePath(lookupCacheStaticFilePath: String): AutoGGUFEmbeddings.this.type

    Set path to static lookup cache to use for lookup decoding (not updated by generation)

    Set path to static lookup cache to use for lookup decoding (not updated by generation)

    Definition Classes
    HasLlamaCppModelProperties
  193. def setLoraAdapters(loraAdapters: HashMap[String, Double]): AutoGGUFEmbeddings.this.type

    Sets paths to lora adapters with user defined scale.

    Sets paths to lora adapters with user defined scale. (PySpark Override)

    Definition Classes
    HasLlamaCppModelProperties
  194. def setLoraAdapters(loraAdapters: Map[String, Float]): AutoGGUFEmbeddings.this.type

    Sets paths to lora adapters with user defined scale.

    Sets paths to lora adapters with user defined scale.

    Definition Classes
    HasLlamaCppModelProperties
  195. 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
  196. def setMetadata(metadata: String): AutoGGUFEmbeddings.this.type

    Set the metadata for the model

    Set the metadata for the model

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

    Set the draft model for speculative decoding

    Set the draft model for speculative decoding

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

  199. 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
  200. def setNChunks(nChunks: Int): AutoGGUFEmbeddings.this.type

    Set the maximal number of chunks to process

    Set the maximal number of chunks to process

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

    Set the size of the prompt context

    Set the size of the prompt context

    Definition Classes
    HasLlamaCppModelProperties
  202. 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
  203. 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
  204. 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
  205. def setNSequences(nSequences: Int): AutoGGUFEmbeddings.this.type

    Set the number of sequences to decode

    Set the number of sequences to decode

    Definition Classes
    HasLlamaCppModelProperties
  206. 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
  207. 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
  208. def setNThreadsBatchDraft(nThreadsBatchDraft: 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
  209. def setNThreadsDraft(nThreadsDraft: Int): AutoGGUFEmbeddings.this.type

    Set the number of threads to use during draft generation

    Set the number of threads to use during draft generation

    Definition Classes
    HasLlamaCppModelProperties
  210. 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
  211. def setNoKvOffload(noKvOffload: Boolean): AutoGGUFEmbeddings.this.type

    Whether to disable KV offload

    Whether to disable KV offload

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

    Overrides annotation column name when transforming

    Overrides annotation column name when transforming

    Definition Classes
    HasOutputAnnotationCol
  214. def setPSplit(pSplit: Float): AutoGGUFEmbeddings.this.type

    Set the speculative decoding split probability

    Set the speculative decoding split probability

    Definition Classes
    HasLlamaCppModelProperties
  215. def setParent(parent: Estimator[AutoGGUFEmbeddings]): AutoGGUFEmbeddings
    Definition Classes
    Model
  216. 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

    • 0 NONE: Don't use any pooling and return token embeddings (if the model supports it)
    • 1 MEAN: Mean Pooling
    • 2 CLS: Choose the CLS token
    • 3 LAST: Choose the last token
    Definition Classes
    HasLlamaCppModelProperties
  217. 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
  218. 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
  219. 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.

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

    Set a system prompt to use

    Set a system prompt to use

    Definition Classes
    HasLlamaCppModelProperties
  221. def setTensorSplit(tensorSplit: Array[Double]): AutoGGUFEmbeddings.this.type

    Set how split tensors should be distributed across GPUs

    Set how split tensors should be distributed across GPUs

    Definition Classes
    HasLlamaCppModelProperties
  222. 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
  223. 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
  224. 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
  225. 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
  226. 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
  227. def setYarnExtFactor(yarnExtFactor: Float): AutoGGUFEmbeddings.this.type

    Set the YaRN extrapolation mix factor

    Set the YaRN extrapolation mix factor

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

    Definition Classes
    HasLlamaCppModelProperties
  231. val tensorSplit: DoubleArrayParam

    Definition Classes
    HasLlamaCppModelProperties
  232. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  233. 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
  234. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  235. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  236. 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
  237. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  238. val uid: String
    Definition Classes
    AutoGGUFEmbeddings → Identifiable
  239. val useMlock: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  240. val useMmap: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  241. 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
  242. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  243. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  244. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  245. def wrapColumnMetadata(col: Column): Column
    Attributes
    protected
    Definition Classes
    RawAnnotator
  246. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  247. val yarnAttnFactor: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  248. val yarnBetaFast: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  249. val yarnBetaSlow: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  250. val yarnExtFactor: FloatParam

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