File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -2197,25 +2197,21 @@ 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 ;
2203- for (auto start_string: slot.params .start_strings )
2204- {
2202+ for (auto start_string: slot.params .start_strings ) {
22052203 max_start_string_size = std::max (max_start_string_size, start_string.size ());
22062204 }
22072205 size_t search_len = max_start_string_size + token_str.size ();
22082206 size_t search_pos = 0 ;
2209- if (slot.generated_text .size () > search_len)
2210- {
2207+ if (slot.generated_text .size () > search_len) {
22112208 search_pos = slot.generated_text .size () - search_len;
22122209 }
22132210
22142211 auto found_pos = slot.generated_text .npos ;
22152212 bool found = false ;
22162213 std::string found_string;
2217- for (auto start_string: slot.params .start_strings )
2218- {
2214+ for (auto start_string: slot.params .start_strings ) {
22192215 found_pos = slot.generated_text .find (start_string,search_pos);
22202216 if (found_pos != slot.generated_text .npos ) {
22212217 found = true ;
You can’t perform that action at this time.
0 commit comments