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,31 @@
|
||||
import MarkBase
|
||||
|
||||
/// Entry point for MarkBase API server
|
||||
/// Usage: swift run G12BServer [model_dir] [port] [model_id] [--benchmark]
|
||||
@main
|
||||
public struct ServerMain {
|
||||
public static func main() async throws {
|
||||
let args = CommandLine.arguments
|
||||
|
||||
// Check for benchmark mode
|
||||
if args.contains("--benchmark") {
|
||||
let modelDir = args.count > 2 ? args[1] : "./model"
|
||||
let modelName = args.count > 3 ? args[2] : "markbase"
|
||||
|
||||
var benchmark = PerformanceBenchmark(modelDir: modelDir, modelName: modelName)
|
||||
try await benchmark.run()
|
||||
return
|
||||
}
|
||||
|
||||
let modelDir = args.count > 1 ? args[1] : "./model"
|
||||
let port = args.count > 2 ? Int(args[2]) ?? 8080 : 8080
|
||||
let modelId = args.count > 3 ? args[3] : "markbase-12b"
|
||||
|
||||
print("\n╔═════════════════════════════════════════════╗")
|
||||
print("║ MarkBase API Server ║")
|
||||
print("╚═════════════════════════════════════════════╝\n")
|
||||
|
||||
let server = try MarkBaseServer(modelDir: modelDir, modelId: modelId)
|
||||
try await server.start(port: port)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user