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 defragmentationThreshold: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  24. val embedding: 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 getEmbedding: 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 getMainGpu: Int

    Definition Classes
    HasLlamaCppModelProperties
  53. def getMetadata: String

    Get the metadata for the model

    Get the metadata for the model

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

    Definition Classes
    HasLlamaCppModelProperties
  56. def getModelIfNotSet: GGUFWrapper

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

    Definition Classes
    HasLlamaCppModelProperties
  59. def getNCtx: Int

    Definition Classes
    HasLlamaCppModelProperties
  60. def getNDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  61. def getNGpuLayers: Int

    Definition Classes
    HasLlamaCppModelProperties
  62. def getNGpuLayersDraft: Int

    Definition Classes
    HasLlamaCppModelProperties
  63. def getNThreads: Int

    Definition Classes
    HasLlamaCppModelProperties
  64. def getNThreadsBatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  65. def getNUbatch: Int

    Definition Classes
    HasLlamaCppModelProperties
  66. def getNoKvOffload: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  67. def getNuma: String

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

    Gets annotation column name going to generate

    Gets annotation column name going to generate

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

    Definition Classes
    HasLlamaCppModelProperties
  72. def getRopeFreqBase: Float

    Definition Classes
    HasLlamaCppModelProperties
  73. def getRopeFreqScale: Float

    Definition Classes
    HasLlamaCppModelProperties
  74. def getRopeScalingType: String

    Definition Classes
    HasLlamaCppModelProperties
  75. def getSplitMode: String

    Definition Classes
    HasLlamaCppModelProperties
  76. def getSystemPrompt: String

    Definition Classes
    HasLlamaCppModelProperties
  77. def getUseMlock: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  78. def getUseMmap: Boolean

    Definition Classes
    HasLlamaCppModelProperties
  79. def getYarnAttnFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  80. def getYarnBetaFast: Float

    Definition Classes
    HasLlamaCppModelProperties
  81. def getYarnBetaSlow: Float

    Definition Classes
    HasLlamaCppModelProperties
  82. def getYarnExtFactor: Float

    Definition Classes
    HasLlamaCppModelProperties
  83. def getYarnOrigCtx: Int

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

    Definition Classes
    HasLlamaCppModelProperties
  112. val metadata: ProtectedParam[String]
    Definition Classes
    HasLlamaCppModelProperties
  113. val modelDraft: Param[String]

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

    Definition Classes
    HasLlamaCppModelProperties
  116. val nCtx: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  117. val nDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  118. val nGpuLayers: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  119. val nGpuLayersDraft: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  120. val nThreads: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  121. val nThreadsBatch: IntParam

    Definition Classes
    HasLlamaCppModelProperties
  122. val nUbatch: IntParam

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

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

    Definition Classes
    HasLlamaCppModelProperties
  136. val ropeFreqScale: FloatParam

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

    Size of every batch.

    Size of every batch.

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

    The chat template to use

    The chat template to use

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

    Set the KV cache defragmentation threshold

    Set the KV cache defragmentation threshold

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

    Whether to load model with embedding support

    Whether to load model with embedding support

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

    Whether to enable Flash Attention

    Whether to enable Flash Attention

    Definition Classes
    HasLlamaCppModelProperties
  158. 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
  159. final def setInputCols(value: String*): AutoGGUFEmbeddings.this.type
    Definition Classes
    HasInputAnnotationCols
  160. 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
  161. def setLazyAnnotator(value: Boolean): AutoGGUFEmbeddings.this.type
    Definition Classes
    CanBeLazy
  162. 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
  163. def setMetadata(metadata: String): AutoGGUFEmbeddings.this.type

    Set the metadata for the model

    Set the metadata for the model

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

    Set the draft model for speculative decoding

    Set the draft model for speculative decoding

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

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

    Set the size of the prompt context

    Set the size of the prompt context

    Definition Classes
    HasLlamaCppModelProperties
  168. 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
  169. 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
  170. 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
  171. 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

  172. 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
  173. 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
  174. 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
  175. def setNoKvOffload(noKvOffload: Boolean): AutoGGUFEmbeddings.this.type

    Whether to disable KV offload

    Whether to disable KV offload

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

    Overrides annotation column name when transforming

    Overrides annotation column name when transforming

    Definition Classes
    HasOutputAnnotationCol
  178. def setParent(parent: Estimator[AutoGGUFEmbeddings]): AutoGGUFEmbeddings
    Definition Classes
    Model
  179. 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:

    • NONE: No pooling
    • MEAN: Mean pooling
    • CLS: Choose the CLS token
    • LAST: Choose the last token
    • RANK: For reranking
    Definition Classes
    HasLlamaCppModelProperties
  180. 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
  181. 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
  182. 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
  183. def setSystemPrompt(systemPrompt: String): AutoGGUFEmbeddings.this.type

    Set a system prompt to use

    Set a system prompt to use

    Definition Classes
    HasLlamaCppModelProperties
  184. 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
  185. 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
  186. 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
  187. 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
  188. 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
  189. def setYarnExtFactor(yarnExtFactor: Float): AutoGGUFEmbeddings.this.type

    Set the YaRN extrapolation mix factor

    Set the YaRN extrapolation mix factor

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

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

    Definition Classes
    HasLlamaCppModelProperties
  201. val useMmap: BooleanParam

    Definition Classes
    HasLlamaCppModelProperties
  202. 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
  203. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  204. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  205. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  206. def wrapColumnMetadata(col: Column): Column
    Attributes
    protected
    Definition Classes
    RawAnnotator
  207. def write: MLWriter
    Definition Classes
    ParamsAndFeaturesWritable → DefaultParamsWritable → MLWritable
  208. val yarnAttnFactor: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  209. val yarnBetaFast: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  210. val yarnBetaSlow: FloatParam

    Definition Classes
    HasLlamaCppModelProperties
  211. val yarnExtFactor: FloatParam

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