]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
main.swift : fix eos checking (#4197)
authoreastriver <redacted>
Fri, 24 Nov 2023 09:25:10 +0000 (18:25 +0900)
committerGitHub <redacted>
Fri, 24 Nov 2023 09:25:10 +0000 (11:25 +0200)
llama_token_eos(const struct llama_model *) is currently getting struct llama_context type variable context as a parameter.

examples/batched.swift/Sources/main.swift

index 772730382ebe0e707ea7d127f8892364fbdc2f5d..ba15197aecf09da644d6fff9224c10cd97539f96 100644 (file)
@@ -153,7 +153,7 @@ while n_cur <= n_len {
         // const llama_token new_token_id = llama_sample_token_greedy(ctx, &candidates_p);
 
         // is it an end of stream? -> mark the stream as finished
-        if new_token_id == llama_token_eos(context) || n_cur == n_len {
+        if new_token_id == llama_token_eos(model) || n_cur == n_len {
             i_batch[i] = -1
             // print("")
             if n_parallel > 1 {