We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68b3cd6 commit ed9ca47Copy full SHA for ed9ca47
examples/simple-chat/simple-chat.cpp
@@ -114,14 +114,15 @@ int main(int argc, char ** argv) {
114
// check if we have enough space in the context to evaluate this batch
115
int n_ctx = llama_n_ctx(ctx);
116
int n_ctx_used = llama_memory_seq_pos_max(llama_get_memory(ctx), 0);
117
- if (n_ctx_used + batch.n_tokens > n_ctx) {
+ if (n_ctx_used + batch.n_tokens >= n_ctx) {
118
printf("\033[0m\n");
119
fprintf(stderr, "context size exceeded\n");
120
exit(0);
121
}
122
123
- if (llama_decode(ctx, batch)) {
124
- GGML_ABORT("failed to decode\n");
+ int ret = llama_decode(ctx, batch);
+ if (ret != 0) {
125
+ GGML_ABORT("failed to decode, ret = %d\n", ret);
126
127
128
// sample the next token
0 commit comments