aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/main/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 453450a..67a34e6 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -431,7 +431,7 @@ int main(int argc, char ** argv) {
}
// end of text token
- if (embd.back() == llama_token_eos()) {
+ if (!embd.empty() && embd.back() == llama_token_eos()) {
if (params.instruct) {
is_interacting = true;
} else {