From bd8fa8221cd9529bf8e2d8efed25cbedebb1f510 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 16 Oct 2023 00:20:03 +0300 Subject: [PATCH] swift : fix build ggml-ci --- examples/batched.swift/Sources/main.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/batched.swift/Sources/main.swift b/examples/batched.swift/Sources/main.swift index 938f30512ca6a8..d2e6540f112f6e 100644 --- a/examples/batched.swift/Sources/main.swift +++ b/examples/batched.swift/Sources/main.swift @@ -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 } @@ -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