@@ -190,7 +190,7 @@ Java_android_llama_cpp_LLamaAndroid_bench_1model(
190190
191191 const int n_tokens = pp;
192192 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 );
194194 }
195195
196196 batch->logits [batch->n_tokens - 1 ] = true ;
@@ -210,9 +210,9 @@ Java_android_llama_cpp_LLamaAndroid_bench_1model(
210210 const auto t_tg_start = ggml_time_us ();
211211 for (i = 0 ; i < tg; i++) {
212212
213- llama_batch_clear (*batch);
213+ common_batch_clear (*batch);
214214 for (j = 0 ; j < pl; j++) {
215- llama_batch_add (*batch, 0 , i, { j }, true );
215+ common_batch_add (*batch, 0 , i, { j }, true );
216216 }
217217
218218 LOGi (" llama_decode() text generation: %d" , i);
@@ -357,7 +357,7 @@ Java_android_llama_cpp_LLamaAndroid_completion_1init(
357357 const auto context = reinterpret_cast <llama_context *>(context_pointer);
358358 const auto batch = reinterpret_cast <llama_batch *>(batch_pointer);
359359
360- const auto tokens_list = llama_tokenize (context, text, 1 );
360+ const auto tokens_list = common_tokenize (context, text, 1 );
361361
362362 auto n_ctx = llama_n_ctx (context);
363363 auto n_kv_req = tokens_list.size () + (n_len - tokens_list.size ());
@@ -369,14 +369,14 @@ Java_android_llama_cpp_LLamaAndroid_completion_1init(
369369 }
370370
371371 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 ());
373373 }
374374
375375 llama_batch_clear (*batch);
376376
377377 // evaluate the initial prompt
378378 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 );
380380 }
381381
382382 // llama_decode will output logits only for the last token of the prompt
@@ -419,7 +419,7 @@ Java_android_llama_cpp_LLamaAndroid_completion_1loop(
419419 return nullptr ;
420420 }
421421
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);
423423 cached_token_chars += new_token_chars;
424424
425425 jstring new_token = nullptr ;
@@ -432,7 +432,7 @@ Java_android_llama_cpp_LLamaAndroid_completion_1loop(
432432 }
433433
434434 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 );
436436
437437 env->CallVoidMethod (intvar_ncur, la_int_var_inc);
438438
0 commit comments