File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2201,13 +2201,14 @@ struct server_context {
22012201 // check if there is incomplete UTF-8 character at the end
22022202 bool incomplete = validate_utf8 (slot.generated_text ) < slot.generated_text .size ();
22032203
2204- // search stop word and delete it
2204+
22052205 if (!incomplete) {
22062206 size_t pos = std::min (slot.n_sent_text , slot.generated_text .size ());
22072207
22082208 const std::string str_test = slot.generated_text .substr (pos);
22092209 bool send_text = true ;
22102210
2211+ // Handle the start strings
22112212 if (!slot.start_string_found && slot.has_next_token && !slot.params .start_strings .empty ()) {
22122213 size_t max_start_string_size = slot.params .start_string_max_len ;
22132214 size_t search_len = max_start_string_size + token_str.size ();
@@ -2231,6 +2232,7 @@ struct server_context {
22312232 }
22322233 }
22332234
2235+ // search stop word and delete it
22342236 size_t stop_pos = slot.find_stopping_strings (str_test, token_str.size (), true );
22352237 if (stop_pos != std::string::npos) {
22362238 slot.generated_text .erase (
You can’t perform that action at this time.
0 commit comments