mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 06:55:26 +00:00
wip
This commit is contained in:
@ -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)
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user