]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama.swiftui : use correct pointer for llama_token_eos (#4797)
authorDaniel Illescas Romero <redacted>
Sat, 6 Jan 2024 15:12:59 +0000 (16:12 +0100)
committerGitHub <redacted>
Sat, 6 Jan 2024 15:12:59 +0000 (17:12 +0200)
examples/llama.swiftui/llama.cpp.swift/LibLlama.swift

index 66244382f5cbc88e6c4333181fcf41c4204e412e..8696b493ce6f48f99afa3d3ac42ffb081584acd2 100644 (file)
@@ -161,7 +161,7 @@ actor LlamaContext {
             new_token_id = llama_sample_token_greedy(context, &candidates_p)
         }
 
-        if new_token_id == llama_token_eos(context) || n_cur == n_len {
+        if new_token_id == llama_token_eos(model) || n_cur == n_len {
             print("\n")
             let new_token_str = String(cString: temporary_invalid_cchars + [0])
             temporary_invalid_cchars.removeAll()