mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-13 03:15:17 +00:00
Restore original return logic for force_accurate condition
This commit is contained in:
parent
648829b770
commit
c3ea048b71
1 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue