@@ -900,7 +900,7 @@ extern "C" {
900900 //
901901 DEPRECATED (LLAMA_API struct llama_batch llama_batch_get_one (
902902 llama_token * tokens,
903- int32_t n_tokens), "use llama_batch_ext API instead");
903+ int32_t n_tokens), "use llama_batch_ext_init_from_text instead");
904904
905905 // Allocates a batch of tokens on the heap that can hold a maximum of n_tokens
906906 // Each token can be assigned up to n_seq_max sequence ids
@@ -912,7 +912,7 @@ extern "C" {
912912 DEPRECATED (LLAMA_API struct llama_batch llama_batch_init (
913913 int32_t n_tokens,
914914 int32_t embd,
915- int32_t n_seq_max), "use llama_batch_ext API instead");
915+ int32_t n_seq_max), "use llama_batch_ext_init instead");
916916
917917 // Frees a batch of tokens allocated with llama_batch_init()
918918 DEPRECATED (LLAMA_API void llama_batch_free (struct llama_batch batch),
@@ -950,28 +950,32 @@ extern "C" {
950950
951951 // Add text tokens to the batch
952952 // Return values:
953- // 0 : success
954953 // -1 : not enough space in the batch
955954 // -2 : embd is already set, cannot add text tokens
955+ // otherwise, returns the output ID
956956 LLAMA_API int32_t llama_batch_ext_add_text (
957957 struct llama_batch_ext * batch,
958958 llama_token token,
959959 llama_pos pos,
960960 const llama_seq_id * seq_ids,
961961 size_t n_seq_ids,
962- float logits );
962+ bool output );
963963
964- // Set logits for the token in the ith sequence
965- // If pos == -1, logits will be set for the all tokens
966- // Returns -1 if the token is not in the batch
967- LLAMA_API int32_t llama_batch_ext_set_logits (
964+ // Set output (logits/embeddings) for the token in the ith sequence
965+ // If pos == -1, output will be set for the all tokens
966+ // Return values:
967+ // -1 : the token is not in the batch
968+ // otherwise, returns the output ID
969+ LLAMA_API int32_t llama_batch_ext_set_output (
968970 struct llama_batch_ext * batch,
969971 llama_pos pos,
970972 llama_seq_id seq_id);
971973
972- // Set logits for the last added token
973- // Returns -1 if there is no tokens in the batch
974- LLAMA_API int32_t llama_batch_ext_set_logits_last (struct llama_batch_ext * batch);
974+ // Set output (logits/embeddings) for the last added token
975+ // Return values:
976+ // -1 : the batch is empty
977+ // otherwise, returns the output ID
978+ LLAMA_API int32_t llama_batch_ext_set_output_last (struct llama_batch_ext * batch);
975979
976980 // Get a "view" from a number of tokens offset
977981 // Return returned batch must be freed with llama_batch_free()
0 commit comments