Skip to content

Commit 4bf7ca3

Browse files
committed
llama_decode_ext
1 parent aed4a8e commit 4bf7ca3

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/server/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3149,7 +3149,7 @@ struct server_context {
31493149

31503150
llama_batch_ext_ptr batch_view(llama_batch_ext_get_view(batch.get(), i, n_tokens));
31513151

3152-
const int ret = llama_text_decode(ctx, batch_view.get());
3152+
const int ret = llama_decode_ext(ctx, batch_view.get());
31533153
metrics.on_decoded(slots);
31543154

31553155
if (ret != 0) {
@@ -3294,7 +3294,7 @@ struct server_context {
32943294

32953295
SLT_DBG(slot, "decoding speculative batch, size = %d\n", llama_batch_ext_get_n_tokens(slot.batch_spec.get()));
32963296

3297-
llama_text_decode(ctx, slot.batch_spec.get());
3297+
llama_decode_ext(ctx, slot.batch_spec.get());
32983298

32993299
// the accepted tokens from the speculation
33003300
const auto ids = common_sampler_sample_and_accept_n(slot.smpl, ctx, draft);

include/llama.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ extern "C" {
944944
DEPRECATED(LLAMA_API int32_t llama_encode(
945945
struct llama_context * ctx,
946946
struct llama_batch batch), "use llama_batch_ext API instead");
947-
LLAMA_API int32_t llama_text_encode(
947+
LLAMA_API int32_t llama_encode_ext(
948948
struct llama_context * ctx,
949949
struct llama_batch_ext * batch);
950950

@@ -955,7 +955,7 @@ extern "C" {
955955
DEPRECATED(LLAMA_API int32_t llama_decode(
956956
struct llama_context * ctx,
957957
struct llama_batch batch), "use llama_batch_ext API instead");
958-
LLAMA_API int32_t llama_text_decode(
958+
LLAMA_API int32_t llama_decode_ext(
959959
struct llama_context * ctx,
960960
struct llama_batch_ext * batch);
961961

src/llama.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9977,7 +9977,7 @@ int32_t llama_encode(
99779977
// also convert llama_batch to llama_batch_ext
99789978
llama_batch_allocr batch_allocr(batch, batch.pos ? -1 : ctx->kv_self.max_pos() + 1);
99799979
llama_batch_ext * batch_ext = batch_allocr.batch;
9980-
return llama_text_encode(ctx, batch_ext);
9980+
return llama_encode_ext(ctx, batch_ext);
99819981
}
99829982

99839983
// DEPRECATED
@@ -9988,10 +9988,10 @@ int32_t llama_decode(
99889988
// also convert llama_batch to llama_batch_ext
99899989
llama_batch_allocr batch_allocr(batch, batch.pos ? -1 : ctx->kv_self.max_pos() + 1);
99909990
llama_batch_ext * batch_ext = batch_allocr.batch;
9991-
return llama_text_decode(ctx, batch_ext);
9991+
return llama_decode_ext(ctx, batch_ext);
99929992
}
99939993

9994-
int32_t llama_text_encode(
9994+
int32_t llama_encode_ext(
99959995
struct llama_context * ctx,
99969996
struct llama_batch_ext * batch) {
99979997
const int ret = llama_encode_impl(*ctx, *batch);
@@ -10002,7 +10002,7 @@ int32_t llama_text_encode(
1000210002
return ret;
1000310003
}
1000410004

10005-
int32_t llama_text_decode(
10005+
int32_t llama_decode_ext(
1000610006
struct llama_context * ctx,
1000710007
struct llama_batch_ext * batch) {
1000810008
const int ret = llama_decode_impl(*ctx, *batch);

0 commit comments

Comments
 (0)