File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -113,15 +113,16 @@ int main(int argc, char ** argv) {
113113 while (true ) {
114114 // check if we have enough space in the context to evaluate this batch
115115 int n_ctx = llama_n_ctx (ctx);
116- int n_ctx_used = llama_memory_seq_pos_max (llama_get_memory (ctx), 0 );
116+ int n_ctx_used = llama_memory_seq_pos_max (llama_get_memory (ctx), 0 ) + 1 ;
117117 if (n_ctx_used + batch.n_tokens > n_ctx) {
118118 printf (" \033 [0m\n " );
119119 fprintf (stderr, " context size exceeded\n " );
120120 exit (0 );
121121 }
122122
123- if (llama_decode (ctx, batch)) {
124- GGML_ABORT (" failed to decode\n " );
123+ int ret = llama_decode (ctx, batch);
124+ if (ret != 0 ) {
125+ GGML_ABORT (" failed to decode, ret = %d\n " , ret);
125126 }
126127
127128 // sample the next token
You can’t perform that action at this time.
0 commit comments