diff --git a/examples/gritlm/gritlm.cpp b/examples/gritlm/gritlm.cpp index bb94d597a..752a4f78c 100644 --- a/examples/gritlm/gritlm.cpp +++ b/examples/gritlm/gritlm.cpp @@ -158,12 +158,17 @@ static std::string generate(llama_context* ctx, const std::string& prompt, bool std::string piece = llama_token_to_piece(ctx, token); if (stream) { std::printf("%s", piece.c_str()); + std::fflush(stdout); } pieces.push_back(piece); inputs.push_back(token); } + if (stream) { + std::printf("\n"); + } + llama_batch_free(bat); return aggregate_pieces(pieces);