Skip to content

Commit a0170fb

Browse files
committed
Refactor chat UI and token generation logic, and handle token generation errors
1 parent 2e5db2a commit a0170fb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

mobile/examples/phi-3/ios/LocalLLM/LocalLLM/ContentView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
14
import SwiftUI
25

36

mobile/examples/phi-3/ios/LocalLLM/LocalLLM/GenAIGenerator.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ @interface GenAIGenerator () {
1818

1919
@implementation GenAIGenerator
2020

21-
typedef std::chrono::high_resolution_clock Clock;
21+
typedef std::chrono::steady_clock Clock;
2222
typedef std::chrono::time_point<Clock> TimePoint;
23+
static std::unique_ptr<OgaModel> model = nullptr;
24+
static std::unique_ptr<OgaTokenizer> tokenizer = nullptr;
2325

2426
typedef std::chrono::steady_clock Clock;
2527
typedef std::chrono::time_point<Clock> TimePoint;

0 commit comments

Comments
 (0)