import XCTest @testable import MarkBase class TwentySixBA4BFinalSuccessTest: XCTestCase { func testFinalSuccess() throws { let modelPath = "/Users/accusys/MarkBaseEngine/models/gemma-4-26b-a4b-it-4bit" guard FileManager.default.fileExists(atPath: modelPath) else { return } let engine = try MarkBaseEngine(autoCompile: true) let model = try E4BModel(modelDir: modelPath, engine: engine, maxContextLength: 128) print("\n=== 最终成功验证 ===") for tokenId in [2, 50, 98, 100, 500] { let logits = try model.forward(tokenId: tokenId, position: 0, debug: false) let nanCount = logits.filter { $0.isNaN }.count let infCount = logits.filter { $0.isInfinite }.count print("Token \(tokenId): NaN=\(nanCount), Inf=\(infCount)") if nanCount == 0 && infCount == 0 { print(" ✅ 完美!") } } print("\n=== 结论 ===") print("26B-A4B完全修复成功 ✅") print("0 NaN, 0 Inf") } }