From 941c710a0035e93ecf2887cd708c0e24c0a4d31c Mon Sep 17 00:00:00 2001 From: Alice Hau Date: Fri, 25 Oct 2024 16:01:57 -0400 Subject: [PATCH] skip token counting to speed up --- packages/exchange/src/exchange/moderators/summarizer.py | 2 +- packages/exchange/src/exchange/moderators/truncate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/exchange/src/exchange/moderators/summarizer.py b/packages/exchange/src/exchange/moderators/summarizer.py index 7a90ed04..1ba32558 100644 --- a/packages/exchange/src/exchange/moderators/summarizer.py +++ b/packages/exchange/src/exchange/moderators/summarizer.py @@ -7,7 +7,7 @@ class ContextSummarizer(ContextTruncate): def rewrite(self, exchange: type["exchange.exchange.Exchange"]) -> None: # noqa: F821 """Summarize the context history up to the last few messages in the exchange""" - self._update_system_prompt_token_count(exchange) + # self._update_system_prompt_token_count(exchange) # TODO: use an offset for summarization if exchange.checkpoint_data.total_token_count < self.max_tokens: diff --git a/packages/exchange/src/exchange/moderators/truncate.py b/packages/exchange/src/exchange/moderators/truncate.py index a9c08b65..1467f033 100644 --- a/packages/exchange/src/exchange/moderators/truncate.py +++ b/packages/exchange/src/exchange/moderators/truncate.py @@ -30,7 +30,7 @@ def __init__( def rewrite(self, exchange: Exchange) -> None: """Truncate the exchange messages with a FIFO strategy.""" - self._update_system_prompt_token_count(exchange) + # self._update_system_prompt_token_count(exchange) if exchange.checkpoint_data.total_token_count < self.max_tokens: return