Skip to content

Commit

Permalink
swift : fix build
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov committed Oct 15, 2023
1 parent b5554b9 commit bd8fa82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/batched.swift/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ batch.n_tokens = Int32(tokens.count)
for (i, token) in tokens.enumerated() {
batch.token[i] = token
batch.pos[i] = Int32(i)
batch.seq_id[i] = 0
batch.n_seq_id[i] = 1
batch.seq_id[i][0] = 0
batch.logits[i] = 0
}

Expand Down Expand Up @@ -169,7 +170,8 @@ while n_cur <= n_len {
// push this new token for next evaluation
batch.token[Int(batch.n_tokens)] = new_token_id
batch.pos[Int(batch.n_tokens)] = n_cur
batch.seq_id[Int(batch.n_tokens)] = Int32(i)
batch.n_seq_id[Int(batch.n_tokens)] = 1
batch.seq_id[Int(batch.n_tokens)][0] = Int32(i)
batch.logits[Int(batch.n_tokens)] = 1

i_batch[i] = batch.n_tokens
Expand Down

0 comments on commit bd8fa82

Please sign in to comment.