Skip to content

Commit

Permalink
fix error handling in LlamaEvent
Browse files Browse the repository at this point in the history
also fixes #4
  • Loading branch information
alexrozanski committed May 3, 2023
1 parent 616a2b9 commit 74eb467
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/llama/LlamaRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/llamaObjCxx/bridge/LlamaEvent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 74eb467

Please sign in to comment.