File tree 1 file changed +3
-1
lines changed 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2201,13 +2201,14 @@ struct server_context {
2201
2201
// check if there is incomplete UTF-8 character at the end
2202
2202
bool incomplete = validate_utf8 (slot.generated_text ) < slot.generated_text .size ();
2203
2203
2204
- // search stop word and delete it
2204
+
2205
2205
if (!incomplete) {
2206
2206
size_t pos = std::min (slot.n_sent_text , slot.generated_text .size ());
2207
2207
2208
2208
const std::string str_test = slot.generated_text .substr (pos);
2209
2209
bool send_text = true ;
2210
2210
2211
+ // Handle the start strings
2211
2212
if (!slot.start_string_found && slot.has_next_token && !slot.params .start_strings .empty ()) {
2212
2213
size_t max_start_string_size = slot.params .start_string_max_len ;
2213
2214
size_t search_len = max_start_string_size + token_str.size ();
@@ -2231,6 +2232,7 @@ struct server_context {
2231
2232
}
2232
2233
}
2233
2234
2235
+ // search stop word and delete it
2234
2236
size_t stop_pos = slot.find_stopping_strings (str_test, token_str.size (), true );
2235
2237
if (stop_pos != std::string::npos) {
2236
2238
slot.generated_text .erase (
You can’t perform that action at this time.
0 commit comments