@@ -7380,12 +7380,8 @@ int llama_eval(
7380
7380
llama_kv_cache_tokens_rm (ctx->kv_self , n_past, -1 );
7381
7381
7382
7382
const int ret = llama_decode_internal (*ctx, llama_batch_get_one (tokens, n_tokens, n_past, 0 ), n_threads);
7383
- if (ret != 0 ) {
7384
- if (ret < 0 ) {
7385
- LLAMA_LOG_ERROR (" %s: failed to decode, ret = %d\n " , __func__, ret);
7386
- }
7387
-
7388
- return ret;
7383
+ if (ret < 0 ) {
7384
+ LLAMA_LOG_ERROR (" %s: failed to decode, ret = %d\n " , __func__, ret);
7389
7385
}
7390
7386
7391
7387
return ret;
@@ -7402,12 +7398,8 @@ int llama_eval_embd(
7402
7398
llama_batch batch = { n_tokens, nullptr , embd, nullptr , nullptr , nullptr , n_past, 1 , 0 , };
7403
7399
7404
7400
const int ret = llama_decode_internal (*ctx, batch, n_threads);
7405
- if (ret != 0 ) {
7406
- if (ret < 0 ) {
7407
- LLAMA_LOG_ERROR (" %s: failed to decode, ret = %d\n " , __func__, ret);
7408
- }
7409
-
7410
- return ret;
7401
+ if (ret < 0 ) {
7402
+ LLAMA_LOG_ERROR (" %s: failed to decode, ret = %d\n " , __func__, ret);
7411
7403
}
7412
7404
7413
7405
return ret;
@@ -7460,12 +7452,8 @@ int llama_decode(
7460
7452
struct llama_batch batch,
7461
7453
int n_threads) {
7462
7454
const int ret = llama_decode_internal (*ctx, batch, n_threads);
7463
- if (ret != 0 ) {
7464
- if (ret < 0 ) {
7465
- LLAMA_LOG_ERROR (" %s: failed to decode, ret = %d\n " , __func__, ret);
7466
- }
7467
-
7468
- return ret;
7455
+ if (ret < 0 ) {
7456
+ LLAMA_LOG_ERROR (" %s: failed to decode, ret = %d\n " , __func__, ret);
7469
7457
}
7470
7458
7471
7459
return ret;
0 commit comments