Initial commit: E4B-MarkBase model integration with passing tests
CI / build-and-test (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
- E4B-MarkBase model (42 layers, 4.4GB) loaded successfully - All Phase 1-6 tests passed (model loading, forward pass, vision/audio towers, token generation, performance) - All stress tests passed (5/5 in 127.6s) - Concurrent inference - Memory stress (67.5 tok/s, 0 NaN) - Continuous generation - Batch processing - Long-running stability - Swift Metal inference engine with multimodal support
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import Foundation
|
||||
|
||||
public struct VisionConfig: Codable {
|
||||
public let hiddenSize: Int
|
||||
public let numAttentionHeads: Int
|
||||
public let numHiddenLayers: Int
|
||||
public let headDim: Int
|
||||
public let globalHeadDim: Int
|
||||
public let intermediateSize: Int
|
||||
public let hiddenAct: String
|
||||
public let rmsNormEps: Float
|
||||
public let outputProjDims: Int
|
||||
public let patchSize: Int
|
||||
public let imageSize: Int
|
||||
|
||||
public init(
|
||||
hiddenSize: Int = 768,
|
||||
numAttentionHeads: Int = 12,
|
||||
numHiddenLayers: Int = 12,
|
||||
headDim: Int = 64,
|
||||
globalHeadDim: Int = 64,
|
||||
intermediateSize: Int = 3072,
|
||||
hiddenAct: String = "gelu_pytorch_tanh",
|
||||
rmsNormEps: Float = 1e-6,
|
||||
outputProjDims: Int = 1536,
|
||||
patchSize: Int = 14,
|
||||
imageSize: Int = 224
|
||||
) {
|
||||
self.hiddenSize = hiddenSize
|
||||
self.numAttentionHeads = numAttentionHeads
|
||||
self.numHiddenLayers = numHiddenLayers
|
||||
self.headDim = headDim
|
||||
self.globalHeadDim = globalHeadDim
|
||||
self.intermediateSize = intermediateSize
|
||||
self.hiddenAct = hiddenAct
|
||||
self.rmsNormEps = rmsNormEps
|
||||
self.outputProjDims = outputProjDims
|
||||
self.patchSize = patchSize
|
||||
self.imageSize = imageSize
|
||||
}
|
||||
|
||||
public var numPatches: Int {
|
||||
(imageSize / patchSize) * (imageSize / patchSize)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user