@@ -2197,30 +2197,30 @@ struct server_context {
21972197 const std::string str_test = slot.generated_text .substr (pos);
21982198 bool send_text = true ;
21992199
2200- if (slot.n_sent_text == 0 && slot.has_next_token && !slot.params .start_strings .empty ()) {
2200+ if (slot.n_sent_text == 0 && slot.has_next_token && !slot.params .start_strings .empty ()) {
22012201 size_t max_start_string_size = 0 ;
2202- for (auto start_string: slot.params .start_strings ) {
2202+ for (auto start_string: slot.params .start_strings ) {
22032203 max_start_string_size = std::max (max_start_string_size, start_string.size ());
22042204 }
22052205 size_t search_len = max_start_string_size + token_str.size ();
22062206 size_t search_pos = 0 ;
2207- if (slot.generated_text .size () > search_len) {
2207+ if (slot.generated_text .size () > search_len) {
22082208 search_pos = slot.generated_text .size () - search_len;
22092209 }
22102210
22112211 auto found_pos = slot.generated_text .npos ;
22122212 bool found = false ;
22132213 std::string found_string;
2214- for (auto start_string: slot.params .start_strings ) {
2214+ for (auto start_string: slot.params .start_strings ) {
22152215 found_pos = slot.generated_text .find (start_string,search_pos);
2216- if (found_pos != slot.generated_text .npos ) {
2216+ if (found_pos != slot.generated_text .npos ) {
22172217 found = true ;
22182218 found_string = start_string;
22192219 break ;
22202220 }
22212221 }
22222222
2223- if (found && slot.generated_text .size () > (found_pos + found_string.size ()) ) {
2223+ if (found && slot.generated_text .size () > (found_pos + found_string.size ()) ) {
22242224 slot.generated_text .erase (
22252225 slot.generated_text .begin (),
22262226 slot.generated_text .begin () + found_pos + found_string.size ());
0 commit comments