v2: add EmbeddingServerApp, fix Sendable issues (WIP)

This commit is contained in:
MarkBase Admin
2026-07-06 09:47:06 +08:00
parent 88aeff7935
commit e7a94b3203
4 changed files with 162 additions and 13 deletions
+10 -2
View File
@@ -1,9 +1,17 @@
import Foundation
// Entry point avoids @main conflict with top-level code
// Entry point routes to appropriate server based on model name
Task {
do {
try await SimpleServerApp.main()
let args = CommandLine.arguments
let modelName = args.count > 1 ? args[1] : "E4B-MarkBase"
let isEmbedding = modelName.contains("embedding") || modelName.contains("embeddinggemma")
if isEmbedding {
try await EmbeddingServerApp.main()
} else {
try await SimpleServerApp.main()
}
} catch {
print("Server error: \(error)")
exit(1)