summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/main/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 388e1f7d..0a22f3c2 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -197,6 +197,11 @@ int main(int argc, char ** argv) {
embd_inp = session_tokens;
}
+ // Should not run without any tokens
+ if (embd_inp.empty()) {
+ embd_inp.push_back(llama_token_bos(ctx));
+ }
+
// Tokenize negative prompt
std::vector<llama_token> guidance_inp;
int guidance_offset = 0;