swift : fix build
ggml-ci
This commit is contained in:
parent
b5554b9e05
commit
b8acb6c9b8
1 changed files with 5 additions and 3 deletions
|
@ -69,7 +69,7 @@ for id: llama_token in tokens {
|
||||||
|
|
||||||
print("\n")
|
print("\n")
|
||||||
|
|
||||||
var batch = llama_batch_init(max(Int32(tokens.count), Int32(n_parallel)), 0)
|
var batch = llama_batch_init(max(Int32(tokens.count), Int32(n_parallel)), 0, 1)
|
||||||
defer {
|
defer {
|
||||||
llama_batch_free(batch)
|
llama_batch_free(batch)
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,8 @@ batch.n_tokens = Int32(tokens.count)
|
||||||
for (i, token) in tokens.enumerated() {
|
for (i, token) in tokens.enumerated() {
|
||||||
batch.token[i] = token
|
batch.token[i] = token
|
||||||
batch.pos[i] = Int32(i)
|
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
|
batch.logits[i] = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +170,8 @@ while n_cur <= n_len {
|
||||||
// push this new token for next evaluation
|
// push this new token for next evaluation
|
||||||
batch.token[Int(batch.n_tokens)] = new_token_id
|
batch.token[Int(batch.n_tokens)] = new_token_id
|
||||||
batch.pos[Int(batch.n_tokens)] = n_cur
|
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
|
batch.logits[Int(batch.n_tokens)] = 1
|
||||||
|
|
||||||
i_batch[i] = batch.n_tokens
|
i_batch[i] = batch.n_tokens
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue