From c3ea048b718510f04637027f0f3ef6a504209a94 Mon Sep 17 00:00:00 2001 From: kkan9ma Date: Wed, 21 May 2025 17:52:51 +0900 Subject: [PATCH] Restore original return logic for force_accurate condition --- pr_agent/algo/token_handler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pr_agent/algo/token_handler.py b/pr_agent/algo/token_handler.py index b8eaac89..5a29da36 100644 --- a/pr_agent/algo/token_handler.py +++ b/pr_agent/algo/token_handler.py @@ -166,8 +166,8 @@ class TokenHandler: """ encoder_estimate = len(self.encoder.encode(patch, disallowed_special=())) - if force_accurate: - return self.get_token_count_by_model_type(patch, encoder_estimate) - # If an estimate is enough (for example, in cases where the maximal allowed tokens is way below the known limits), return it. - return encoder_estimate + if not force_accurate: + return encoder_estimate + + return self.get_token_count_by_model_type(patch, encoder_estimate)