Skip to content

Commit c426837

Browse files
committed
server : fix server_sent_event + enable verbose logs
1 parent bd40c57 commit c426837

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.github/workflows/server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ jobs:
116116
id: server_integration_tests
117117
run: |
118118
cd examples/server/tests
119-
PORT=8888 ./tests.sh
119+
LLAMA_LOG=10 PORT=8888 ./tests.sh
120120
121121
- name: Slow tests
122122
id: server_integration_tests_slow
123123
if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }}
124124
run: |
125125
cd examples/server/tests
126-
PORT=8888 ./tests.sh --stop --no-skipped --no-capture --tags slow
126+
LLAMA_LOG=10 PORT=8888 ./tests.sh --stop --no-skipped --no-capture --tags slow
127127
128128
129129
server-windows:

examples/server/tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

examples/server/utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ static json probs_vector_to_json(const llama_context * ctx, const std::vector<co
295295
static bool server_sent_event(httplib::DataSink & sink, const char * event, const json & data) {
296296
const std::string str =
297297
std::string(event) + ": " +
298-
data.dump(-1, ' ', false, json::error_handler_t::replace);
298+
data.dump(-1, ' ', false, json::error_handler_t::replace) + "\n\n";
299299

300-
LOG_DBG("data stream, to_send: %s\n\n", str.c_str());
300+
LOG_DBG("data stream, to_send: %s", str.c_str());
301301

302302
return sink.write(str.c_str(), str.size());
303303
}

0 commit comments

Comments
 (0)