From 7732865e4c7f3b1bdd47a5741732bf802e3698c4 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Tue, 12 Dec 2023 16:36:47 -0500 Subject: [PATCH] Another explanatory comment --- public/script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/script.js b/public/script.js index cd95d6e0c..98e31e8ad 100644 --- a/public/script.js +++ b/public/script.js @@ -2805,6 +2805,8 @@ class StreamingProcessor { scrollLock = false; } + // Stopping strings are expensive to calculate, especially with macros enabled. To remove stopping strings + // when streaming, we cache the result of getStoppingStrings instead of calling it once per token. const isImpersonate = this.type == 'impersonate'; const isContinue = this.type == 'continue'; this.stoppingStrings = getStoppingStrings(isImpersonate, isContinue);