@@ -190,7 +190,7 @@ Java_android_llama_cpp_LLamaAndroid_bench_1model(
190
190
191
191
const int n_tokens = pp;
192
192
for (i = 0 ; i < n_tokens; i++) {
193
- llama_batch_add (*batch, 0 , i, { 0 }, false );
193
+ common_batch_add (*batch, 0 , i, { 0 }, false );
194
194
}
195
195
196
196
batch->logits [batch->n_tokens - 1 ] = true ;
@@ -210,9 +210,9 @@ Java_android_llama_cpp_LLamaAndroid_bench_1model(
210
210
const auto t_tg_start = ggml_time_us ();
211
211
for (i = 0 ; i < tg; i++) {
212
212
213
- llama_batch_clear (*batch);
213
+ common_batch_clear (*batch);
214
214
for (j = 0 ; j < pl; j++) {
215
- llama_batch_add (*batch, 0 , i, { j }, true );
215
+ common_batch_add (*batch, 0 , i, { j }, true );
216
216
}
217
217
218
218
LOGi (" llama_decode() text generation: %d" , i);
@@ -357,7 +357,7 @@ Java_android_llama_cpp_LLamaAndroid_completion_1init(
357
357
const auto context = reinterpret_cast <llama_context *>(context_pointer);
358
358
const auto batch = reinterpret_cast <llama_batch *>(batch_pointer);
359
359
360
- const auto tokens_list = llama_tokenize (context, text, 1 );
360
+ const auto tokens_list = common_tokenize (context, text, 1 );
361
361
362
362
auto n_ctx = llama_n_ctx (context);
363
363
auto n_kv_req = tokens_list.size () + (n_len - tokens_list.size ());
@@ -369,14 +369,14 @@ Java_android_llama_cpp_LLamaAndroid_completion_1init(
369
369
}
370
370
371
371
for (auto id : tokens_list) {
372
- LOGi (" %s" , llama_token_to_piece (context, id).c_str ());
372
+ LOGi (" %s" , common_token_to_piece (context, id).c_str ());
373
373
}
374
374
375
375
llama_batch_clear (*batch);
376
376
377
377
// evaluate the initial prompt
378
378
for (auto i = 0 ; i < tokens_list.size (); i++) {
379
- llama_batch_add (*batch, tokens_list[i], i, { 0 }, false );
379
+ common_batch_add (*batch, tokens_list[i], i, { 0 }, false );
380
380
}
381
381
382
382
// llama_decode will output logits only for the last token of the prompt
@@ -419,7 +419,7 @@ Java_android_llama_cpp_LLamaAndroid_completion_1loop(
419
419
return nullptr ;
420
420
}
421
421
422
- auto new_token_chars = llama_token_to_piece (context, new_token_id);
422
+ auto new_token_chars = common_token_to_piece (context, new_token_id);
423
423
cached_token_chars += new_token_chars;
424
424
425
425
jstring new_token = nullptr ;
@@ -432,7 +432,7 @@ Java_android_llama_cpp_LLamaAndroid_completion_1loop(
432
432
}
433
433
434
434
llama_batch_clear (*batch);
435
- llama_batch_add (*batch, new_token_id, n_cur, { 0 }, true );
435
+ common_batch_add (*batch, new_token_id, n_cur, { 0 }, true );
436
436
437
437
env->CallVoidMethod (intvar_ncur, la_int_var_inc);
438
438
0 commit comments