File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -2197,25 +2197,22 @@ 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 ())
2201- {
2200+ if (slot.n_sent_text == 0 && slot.has_next_token && !slot.params .start_strings .empty ()) {
22022201 size_t max_start_string_size = 0 ;
22032202 for (auto start_string: slot.params .start_strings )
22042203 {
22052204 max_start_string_size = std::max (max_start_string_size, start_string.size ());
22062205 }
22072206 size_t search_len = max_start_string_size + token_str.size ();
22082207 size_t search_pos = 0 ;
2209- if (slot.generated_text .size () > search_len)
2210- {
2208+ if (slot.generated_text .size () > search_len) {
22112209 search_pos = slot.generated_text .size () - search_len;
22122210 }
22132211
22142212 auto found_pos = slot.generated_text .npos ;
22152213 bool found = false ;
22162214 std::string found_string;
2217- for (auto start_string: slot.params .start_strings )
2218- {
2215+ for (auto start_string: slot.params .start_strings ) {
22192216 found_pos = slot.generated_text .find (start_string,search_pos);
22202217 if (found_pos != slot.generated_text .npos ) {
22212218 found = true ;
You can’t perform that action at this time.
0 commit comments