diff --git a/Sources/llama/LlamaRunner.swift b/Sources/llama/LlamaRunner.swift index 3c652687de9c6..08f8b8d973fe0 100644 --- a/Sources/llama/LlamaRunner.swift +++ b/Sources/llama/LlamaRunner.swift @@ -36,7 +36,7 @@ public class LlamaRunner { case initializing case generatingOutput case completed - case failed(error: Error) + case failed(error: Error?) } public let modelURL: URL diff --git a/Sources/llamaObjCxx/bridge/LlamaEvent.mm b/Sources/llamaObjCxx/bridge/LlamaEvent.mm index 880b506e69b57..b1f34a9005f0d 100644 --- a/Sources/llamaObjCxx/bridge/LlamaEvent.mm +++ b/Sources/llamaObjCxx/bridge/LlamaEvent.mm @@ -78,7 +78,7 @@ + (instancetype)completed + (instancetype)failedWithError:(nonnull NSError *)error { - _LlamaEvent *event = [[_LlamaEvent alloc] initWithEventType:LlamaEventTypeFailed data:{}]; + _LlamaEvent *event = [[_LlamaEvent alloc] initWithEventType:LlamaEventTypeFailed data:{ .failed_error = error }]; return event; }