send empty string when got stop_pos in partial
This commit is contained in:
parent
de8cd113c6
commit
e1911ac47c
1 changed files with 4 additions and 1 deletions
|
@ -1287,7 +1287,10 @@ int main(int argc, char **argv)
|
||||||
STOP_PARTIAL);
|
STOP_PARTIAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string to_send = llama.generated_text.substr(pos, stop_pos);
|
const std::string to_send = stop_pos == std::string::npos
|
||||||
|
? llama.generated_text.substr(pos, std::string::npos)
|
||||||
|
: ""; // just don't send anything if we're not done
|
||||||
|
|
||||||
sent_count += to_send.size();
|
sent_count += to_send.size();
|
||||||
|
|
||||||
std::vector<completion_token_output> probs_output = {};
|
std::vector<completion_token_output> probs_output = {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue