summaryrefslogtreecommitdiff
path: root/examples/llama.swiftui
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2024-04-21 18:36:45 +0300
committerGitHub <noreply@github.com>2024-04-21 18:36:45 +0300
commit40f74e4d739e9250431cf339ae7588b28d8d0663 (patch)
tree6008461e7a055c9b86c39df7117b943f1ecc0598 /examples/llama.swiftui
parentb9cc76d87e3d7ae5900f19d4fe8f8976d0a35888 (diff)
llama : add option to render special/control tokens (#6807)
* make : fix common dep on llama.h * llama : add option to render special tokens * readme : add API change notice ggml-ci * swift : fix build
Diffstat (limited to 'examples/llama.swiftui')
-rw-r--r--examples/llama.swiftui/llama.cpp.swift/LibLlama.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift b/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift
index 70c43a38..737f882f 100644
--- a/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift
+++ b/examples/llama.swiftui/llama.cpp.swift/LibLlama.swift
@@ -322,7 +322,7 @@ actor LlamaContext {
defer {
result.deallocate()
}
- let nTokens = llama_token_to_piece(model, token, result, 8)
+ let nTokens = llama_token_to_piece(model, token, result, 8, false)
if nTokens < 0 {
let newResult = UnsafeMutablePointer<Int8>.allocate(capacity: Int(-nTokens))
@@ -330,7 +330,7 @@ actor LlamaContext {
defer {
newResult.deallocate()
}
- let nNewTokens = llama_token_to_piece(model, token, newResult, -nTokens)
+ let nNewTokens = llama_token_to_piece(model, token, newResult, -nTokens, false)
let bufferPointer = UnsafeBufferPointer(start: newResult, count: Int(nNewTokens))
return Array(bufferPointer)
} else {