Skip to content

Commit

Permalink
main.swift : fix eos checking (#4197)
Browse files Browse the repository at this point in the history
llama_token_eos(const struct llama_model *) is currently getting struct llama_context type variable context as a parameter.
  • Loading branch information
eastriverlee authored Nov 24, 2023
1 parent b35f3d0 commit 2568a4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/batched.swift/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2568a4b

Please sign in to comment.