Skip to content

Commit 8ca9913

Browse files
committed
fix comments
1 parent d7063d7 commit 8ca9913

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/server/server.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)