Transformer
class Transformer(val vocabularySize: Int, val dimension: Int, val numLayers: Int, val numHeads: Int, val hiddenDimension: Int = 4 * dimension, val numKeyValueHeads: Int = numHeads, val normEps: Float = 1.0E-6f, val ropeTheta: Float = 10000.0f, val ropeScaling: RoPEScaling? = null, quantization: Quantization? = null) : Module(source)
Constructors
Link copied to clipboard
constructor(vocabularySize: Int, dimension: Int, numLayers: Int, numHeads: Int, hiddenDimension: Int = 4 * dimension, numKeyValueHeads: Int = numHeads, normEps: Float = 1.0E-6f, ropeTheta: Float = 10000.0f, ropeScaling: RoPEScaling? = null, quantization: Quantization? = null)
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun generateStream(prompt: IntArray, maxTokens: Int, stopTokens: Set<Int> = emptySet()): Sequence<Int>
fun generateStream(prompt: IntArray, maxTokens: Int, stopTokens: Set<Int>, prefix: PromptPrefix): Sequence<Int>
fun generateStream(prompt: IntArray, maxTokens: Int, stopTokens: Set<Int>, sampling: Sampling): Sequence<Int>
fun generateStream(prompt: IntArray, maxTokens: Int, stopTokens: Set<Int>, prefix: PromptPrefix, sampling: Sampling): Sequence<Int>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard