Packages

trait Generate extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Generate
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def getModelOutput(encoderInputIds: Seq[Array[Int]], decoderInputIds: Seq[Array[Int]], decoderEncoderStateTensors: Either[Tensor, OnnxTensor], encoderAttentionMaskTensors: Either[Tensor, OnnxTensor], maxLength: Int, session: Either[Session, (OrtEnvironment, OrtSession)], ovInferRequest: Option[InferRequest] = None): Array[Array[Float]]

    Calls the model and returns the output logits.

    Calls the model and returns the output logits.

    encoderInputIds

    Input IDs for the Encoder

    decoderInputIds

    Input IDs for the Decoder

    decoderEncoderStateTensors

    Tensor of encoded input for the decoder

    encoderAttentionMaskTensors

    Tensor for encoder attention mask

    maxLength

    Max length of the input

    session

    Tensorflow Session

    returns

    Logits for the input

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def beamSearch(encoderInputIdsVals: Seq[Array[Int]], inputIdsVal: Seq[Array[Int]], decoderEncoderStateTensors: Either[Tensor, OnnxTensor], encoderAttentionMaskTensors: Either[Tensor, OnnxTensor], beamScorer: BeamScorer, logitProcessor: LogitProcessorList, maxLength: Int, padTokenId: Int, eosTokenId: Int, doSample: Boolean, randomSeed: Option[Long], session: Either[Session, (OrtEnvironment, OrtSession)], applySoftmax: Boolean, ovInferRequest: Option[InferRequest] = None, stopTokenIds: Array[Int] = Array()): Array[Array[Int]]

    Beam Search for text generation

    Beam Search for text generation

    encoderInputIdsVals

    encoder input ids vals

    inputIdsVal

    input ids val

    decoderEncoderStateTensors

    decoder encoder state tensors

    encoderAttentionMaskTensors

    encoder attention mask tensors

    beamScorer

    beam scorer

    logitProcessor

    logit processor

    maxLength

    max length

    padTokenId

    pad token id

    eosTokenId

    eos token id

    doSample

    do sample

    randomSeed

    random seed

    session

    session

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def generate(inputIds: Seq[Array[Int]], decoderEncoderStateTensors: Either[Tensor, OnnxTensor], encoderAttentionMaskTensors: Either[Tensor, OnnxTensor], decoderInputs: Array[Array[Int]], maxOutputLength: Int, minOutputLength: Int, doSample: Boolean, beamSize: Int, numReturnSequences: Int, temperature: Double, topK: Int, topP: Double, repetitionPenalty: Double, noRepeatNgramSize: Int, vocabSize: Int, eosTokenId: Int, paddingTokenId: Int, randomSeed: Option[Long], ignoreTokenIds: Array[Int] = Array(), session: Either[Session, (OrtEnvironment, OrtSession)], applySoftmax: Boolean = true, ovInferRequest: Option[InferRequest] = None, stopTokenIds: Array[Int] = Array()): Array[Array[Int]]

    Text Generation using Beam Search

    Text Generation using Beam Search

    inputIds

    input ids

    decoderEncoderStateTensors

    decoder encoder state tensors

    encoderAttentionMaskTensors

    encoder attention mask tensors

    decoderInputs

    decoder inputs

    maxOutputLength

    max output length

    minOutputLength

    min output length

    doSample

    do sample

    beamSize

    beam size

    numReturnSequences

    num return sequences

    temperature

    temperature

    topK

    top K

    topP

    top P

    repetitionPenalty

    repetition penalty

    noRepeatNgramSize

    no repeat ngram size

    vocabSize

    vocab size

    eosTokenId

    eos token id

    paddingTokenId

    padding token id

    randomSeed

    random seed

    ignoreTokenIds

    ignore token ids

    session

    session

    returns

    Array of generated sequences

  11. def getCDF(probs: Array[Float]): Array[Float]
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def logSoftmax(values: Array[Float]): Array[Float]
  16. def multinomialSampling(logitValues: Array[Float], k: Int, seed: Option[Long]): Array[Int]

    Samples from a multinomial distribution using the provided logits.

    Samples from a multinomial distribution using the provided logits.

    logitValues

    The logits to sample from

    k

    The number of samples to draw

    seed

    The random seed to use

    returns

    The sampled indices

  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def reshapeArray(inputArray: Array[Array[Float]], numRows: Int, numCols: Int): Array[Array[Float]]

    Reshapes a 1D array into a 2D array with the specified number of rows and columns.

    Reshapes a 1D array into a 2D array with the specified number of rows and columns.

    inputArray

    The input array to reshape

    numRows

    The number of rows in the output array

    numCols

    The number of columns in the output array

    returns

    The reshaped array

  21. def sample(logits: Seq[Float], k: Int, seed: Long = 42): Array[Int]

    Samples from a multinomial distribution using the provided logits.

    Samples from a multinomial distribution using the provided logits.

    logits

    The logits to sample from

    k

    The number of samples to draw

    seed

    The random seed to use

    returns

    The sampled indices

  22. def softmax(logitValues: Array[Float]): Array[Float]
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped