Skip to content

Distribute and run LLMs with a single file.

Add special tokens to server llama_decode() inputs

Justine Tunney790029485fdd
diff --git a/llama.cpp/main/main.1 b/llama.cpp/main/main.1
index f1a96c09..d2f51bfc 100644
--- a/llama.cpp/main/main.1
+++ b/llama.cpp/main/main.1
@@ -559,6 +559,19 @@ Print token count every
tokens.
.Pp
Default: -1
+.It Fl Fl pooling Ar KIND
+Specifies pooling type for embeddings. This may be one of:
+.Pp
+.Bl -dash -compact
+.It
+none
+.It
+mean
+.It
+cls
+.El
+.Pp
+The model default is used if unspecified.
.El
.Sh CLI OPTIONS
The following options may be specified when
@@ -741,10 +754,6 @@ Path from which to serve static files.
.Pp
Default:
.Pa /zip/llama.cpp/server/public
-.It Fl Fl embedding
-Enable embedding vector output.
-.Pp
-Default: disabled
.It Fl Fl nobrowser
Do not attempt to open a web browser tab at startup.
.It Fl gan Ar N , Fl Fl grp-attn-n Ar N
diff --git a/llama.cpp/main/main.1.asc b/llama.cpp/main/main.1.asc
index 1da9ca4c..df24c93c 100644
--- a/llama.cpp/main/main.1.asc
+++ b/llama.cpp/main/main.1.asc
@@ -537,6 +537,15 @@
Default: ‐1
+ --pooling KIND
+ Specifies pooling type for embeddings. This may be one of:
+
+ - none
+ - mean
+ - cls
+
+ The model default is used if unspecified.
+
CLI OPTIONS
The following options may be specified when llamafile is running in
--cli mode.
@@ -737,11 +746,6 @@
Default: /zip/llama.cpp/server/public
- --embedding
- Enable embedding vector output.
-
- Default: disabled
-
--nobrowser
Do not attempt to open a web browser tab at startup.
diff --git a/llama.cpp/server/server.cpp b/llama.cpp/server/server.cpp
index 31e79b16..26d765f6 100644
--- a/llama.cpp/server/server.cpp
+++ b/llama.cpp/server/server.cpp
@@ -1783,7 +1783,7 @@ struct llama_server_context
}
else
{
- prompt_tokens = tokenize(slot.prompt, system_prompt.empty() && add_bos_token); // add BOS if there isn't system prompt
+ prompt_tokens = tokenize(slot.prompt, system_prompt.empty()); // add BOS if there isn't system prompt
}
slot.num_prompt_tokens = prompt_tokens.size();