summaryrefslogtreecommitdiff
path: root/llama.cpp_silent_prompt.patch
diff options
context:
space:
mode:
authortslil clingman <>2023-12-31 19:51:03 +0100
committertslil clingman <>2023-12-31 19:51:03 +0100
commit925e8232de9780f5bce86daf13f6d616363a5594 (patch)
treeba17ca34459a3e5977239bf679db66f84d4df033 /llama.cpp_silent_prompt.patch
parent4101f638ada9fa4c7c7dccaa2bffcb03d0a34376 (diff)
[emacs] track jart's copilot and patch for --silent-prompt
Diffstat (limited to 'llama.cpp_silent_prompt.patch')
-rw-r--r--llama.cpp_silent_prompt.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/llama.cpp_silent_prompt.patch b/llama.cpp_silent_prompt.patch
new file mode 100644
index 0000000..71b6ad8
--- /dev/null
+++ b/llama.cpp_silent_prompt.patch
@@ -0,0 +1,49 @@
+commit 90b0d35e400a078545401840f78c0bf02207864d
+Author: tslil clingman <>
+Date: Sun Dec 31 18:50:17 2023 +0100
+
+ add --silent-prompt
+
+diff --git a/common/common.cpp b/common/common.cpp
+index eacaee1..f939b50 100644
+--- a/common/common.cpp
++++ b/common/common.cpp
+@@ -592,6 +592,8 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) {
+ params.numa = true;
+ } else if (arg == "--verbose-prompt") {
+ params.verbose_prompt = true;
++ } else if (arg == "--silent-prompt") {
++ params.silent_prompt = true;
+ } else if (arg == "-r" || arg == "--reverse-prompt") {
+ if (++i >= argc) {
+ invalid_param = true;
+diff --git a/common/common.h b/common/common.h
+index 9659aa0..01c68fa 100644
+--- a/common/common.h
++++ b/common/common.h
+@@ -122,6 +122,7 @@ struct gpt_params {
+ bool use_mlock = false; // use mlock to keep model in memory
+ bool numa = false; // attempt optimizations that help on some NUMA systems
+ bool verbose_prompt = false; // print prompt tokens before generation
++ bool silent_prompt = false; // don't print prompt to stdout
+ bool infill = false; // use infill mode
+ bool dump_kv_cache = false; // dump the KV cache contents for debugging purposes
+ bool no_kv_offload = false; // disable KV offloading
+@@ -240,4 +241,3 @@ void dump_kv_cache_view(const llama_kv_cache_view & view, int row_size = 80);
+
+ // Dump the KV cache view showing individual sequences in each cell (long output).
+ void dump_kv_cache_view_seqs(const llama_kv_cache_view & view, int row_size = 40);
+-
+diff --git a/examples/main/main.cpp b/examples/main/main.cpp
+index c096f11..8676ab4 100644
+--- a/examples/main/main.cpp
++++ b/examples/main/main.cpp
+@@ -461,7 +461,7 @@ int main(int argc, char ** argv) {
+ }
+
+ bool is_antiprompt = false;
+- bool input_echo = true;
++ bool input_echo = !params.silent_prompt;
+ bool need_to_save_session = !path_session.empty() && n_matching_session_tokens < embd_inp.size();
+
+ int n_past = 0;