summaryrefslogtreecommitdiff
path: root/examples/main
diff options
context:
space:
mode:
Diffstat (limited to 'examples/main')
-rw-r--r--examples/main/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index f3e445c1..9dee4100 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -523,6 +523,10 @@ int main(int argc, char ** argv) {
}
struct llama_sampling_context * ctx_sampling = llama_sampling_init(sparams);
+ if (!ctx_sampling) {
+ fprintf(stderr, "%s: failed to initialize sampling subsystem\n", __func__);
+ exit(1);
+ }
while ((n_remain != 0 && !is_antiprompt) || params.interactive) {
// predict