ollama/llm/patches/01-cache.diff
2024-03-08 00:26:20 -08:00

19 lines
576 B
Diff

diff --git a/examples/server/server.cpp b/examples/server/server.cpp
index f255ad76..914ecfdd 100644
--- a/examples/server/server.cpp
+++ b/examples/server/server.cpp
@@ -1101,12 +1101,13 @@ struct server_context {
// add the token to slot queue and cache
}
- slot.add_token_string(result);
if (slot.params.stream) {
send_partial_response(slot, result);
}
}
+ slot.add_token_string(result);
+
if (incomplete) {
slot.has_next_token = true;
}