stop generating when the stream is closed
This commit is contained in:
parent
7a8104fbd2
commit
3a079d5cc8
1 changed files with 6 additions and 1 deletions
|
@ -860,7 +860,12 @@ int main(int argc, char **argv)
|
||||||
data.dump(llama.json_indent, ' ', false,
|
data.dump(llama.json_indent, ' ', false,
|
||||||
json::error_handler_t::replace) +
|
json::error_handler_t::replace) +
|
||||||
"\n\n";
|
"\n\n";
|
||||||
sink.write(str.data(), str.size());
|
if (!sink.write(str.data(), str.size())) {
|
||||||
|
if (llama.verbose) {
|
||||||
|
fprintf(stderr, "stream closed\n");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sink.done();
|
sink.done();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue