This commit is contained in:
mii443
2025-07-25 03:09:46 +09:00
parent f8a171a6f5
commit 4384e2c2af
2 changed files with 6 additions and 5 deletions

View File

@ -146,12 +146,14 @@ final class ZenzContext {
debugLog("[ZenzContext] Loading model from: \(path)")
// Log struct details
// First, log the memory address
withUnsafePointer(to: &model_params) { ptr in
debugLog("[ZenzContext] model_params address: \(ptr)")
withUnsafeBytes(of: model_params) { bytes in
let hexString = bytes.map { String(format: "%02X", $0) }.joined(separator: " ")
debugLog("[ZenzContext] model_params bytes (first 32): \(String(hexString.prefix(95)))...")
}
}
// Then, log the raw bytes in a separate closure to avoid overlapping access
withUnsafeBytes(of: model_params) { bytes in
let hexString = bytes.map { String(format: "%02X", $0) }.joined(separator: " ")
debugLog("[ZenzContext] model_params bytes (first 32): \(String(hexString.prefix(95)))...")
}
debugLog("[ZenzContext] Calling llama_model_load_from_file...")
let model = llama_model_load_from_file(path, model_params)

View File

@ -19,7 +19,6 @@ private let _isDebugLogEnabled = false // true にすると従来通り出力さ
@_disfavoredOverload
@inlinable public func debug(_ items: Any...) {
#if DEBUG
guard _isDebugLogEnabled else { return }
var result = ""
for value in items {
if result.isEmpty {