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) {
113
113
while (true ) {
114
114
// check if we have enough space in the context to evaluate this batch
115
115
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 ;
117
117
if (n_ctx_used + batch.n_tokens > n_ctx) {
118
118
printf (" \033 [0m\n " );
119
119
fprintf (stderr, " context size exceeded\n " );
120
120
exit (0 );
121
121
}
122
122
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);
125
126
}
126
127
127
128
// sample the next token
You can’t perform that action at this time.
0 commit comments