Skip to content

Commit

Permalink
fix: loss ending done data
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <thxcode0824@gmail.com>
  • Loading branch information
thxCode committed Jul 3, 2024
1 parent b4406f7 commit 76c20fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llama-box/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3131,6 +3131,12 @@ int main(int argc, char **argv) {
continue;
}

const std::string done = "data: [DONE] \n\n";
if (!sink.write(done.c_str(), done.size())) {
sink.done();
return false;
}

sink.done_with_trailer({{"X-Response-Tokens-Per-Second",
std::to_string(json_value(result.data.at("timings"),
"predicted_per_second", tps))}});
Expand Down

0 comments on commit 76c20fd

Please sign in to comment.