@@ -7401,39 +7401,6 @@ static struct ggml_cgraph * llama_build_graph(
74017401 return result;
74027402}
74037403
7404- // decode a batch of tokens by evaluating the transformer
7405- // in case of unsuccessful decoding (error or warning),
7406- // the kv_cache state will be returned to its original state
7407- // (for non-recurrent models) or cleaned (for recurrent models)
7408- //
7409- // - lctx: llama context
7410- // - inp_batch: batch to evaluate
7411- //
7412- // return 0 on success
7413- // return positive int on warning
7414- // return negative int on error
7415- //
7416- static int llama_decode_impl (
7417- llama_context & lctx,
7418- llama_batch inp_batch) {
7419- return lctx.decode (inp_batch);
7420- }
7421-
7422- // encode a batch of tokens by evaluating the encoder part of the transformer
7423- //
7424- // - lctx: llama context
7425- // - batch: batch to evaluate
7426- //
7427- // return 0 on success
7428- // return positive int on warning
7429- // return negative int on error
7430- //
7431- static int llama_encode_impl (
7432- llama_context & lctx,
7433- llama_batch inp_batch) {
7434- return lctx.encode (inp_batch);
7435- }
7436-
74377404//
74387405// interface implementation
74397406//
@@ -7759,30 +7726,6 @@ struct llama_context * llama_new_context_with_model(
77597726 return llama_init_from_model (model, params);
77607727}
77617728
7762- // /
7763-
7764- int32_t llama_encode (
7765- struct llama_context * ctx,
7766- struct llama_batch batch) {
7767- const int ret = llama_encode_impl (*ctx, batch);
7768- if (ret != 0 ) {
7769- LLAMA_LOG_ERROR (" %s: failed to encode, ret = %d\n " , __func__, ret);
7770- }
7771-
7772- return ret;
7773- }
7774-
7775- int32_t llama_decode (
7776- struct llama_context * ctx,
7777- struct llama_batch batch) {
7778- const int ret = llama_decode_impl (*ctx, batch);
7779- if (ret != 0 ) {
7780- LLAMA_LOG_ERROR (" %s: failed to decode, ret = %d\n " , __func__, ret);
7781- }
7782-
7783- return ret;
7784- }
7785-
77867729//
77877730// chat templates
77887731//
0 commit comments