v2: add embedding tests, multilingual embedding support
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import Foundation
|
||||
|
||||
/// EmbeddingGemma model configuration
|
||||
public struct EmbeddingGemmaConfig: Codable {
|
||||
public let hiddenSize: Int
|
||||
public let numHiddenLayers: Int
|
||||
public let vocabSize: Int
|
||||
public let numAttentionHeads: Int
|
||||
public let numKeyValueHeads: Int
|
||||
public let headDim: Int
|
||||
public let intermediateSize: Int
|
||||
public let maxPositionEmbeddings: Int
|
||||
public let slidingWindow: Int
|
||||
public let rmsNormEps: Float
|
||||
public let ropeTheta: Float
|
||||
public let useBidirectionalAttention: Bool
|
||||
public let layerTypes: [String]
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case hiddenSize = "hidden_size"
|
||||
case numHiddenLayers = "num_hidden_layers"
|
||||
case vocabSize = "vocab_size"
|
||||
case numAttentionHeads = "num_attention_heads"
|
||||
case numKeyValueHeads = "num_key_value_heads"
|
||||
case headDim = "head_dim"
|
||||
case intermediateSize = "intermediate_size"
|
||||
case maxPositionEmbeddings = "max_position_embeddings"
|
||||
case slidingWindow = "sliding_window"
|
||||
case rmsNormEps = "rms_norm_eps"
|
||||
case ropeTheta = "rope_theta"
|
||||
case useBidirectionalAttention = "use_bidirectional_attention"
|
||||
case layerTypes = "layer_types"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user