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 {
2197
2197
const std::string str_test = slot.generated_text .substr (pos);
2198
2198
bool send_text = true ;
2199
2199
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 ()) {
2202
2201
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 ) {
2205
2203
max_start_string_size = std::max (max_start_string_size, start_string.size ());
2206
2204
}
2207
2205
size_t search_len = max_start_string_size + token_str.size ();
2208
2206
size_t search_pos = 0 ;
2209
- if (slot.generated_text .size () > search_len)
2210
- {
2207
+ if (slot.generated_text .size () > search_len) {
2211
2208
search_pos = slot.generated_text .size () - search_len;
2212
2209
}
2213
2210
2214
2211
auto found_pos = slot.generated_text .npos ;
2215
2212
bool found = false ;
2216
2213
std::string found_string;
2217
- for (auto start_string: slot.params .start_strings )
2218
- {
2214
+ for (auto start_string: slot.params .start_strings ) {
2219
2215
found_pos = slot.generated_text .find (start_string,search_pos);
2220
2216
if (found_pos != slot.generated_text .npos ) {
2221
2217
found = true ;
You can’t perform that action at this time.
0 commit comments