mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 17:56:23 +02:00
fix base_llm.py obfuscate error
This commit is contained in:
parent
b1d75272ff
commit
b2e8be2d78
1 changed files with 1 additions and 2 deletions
|
|
@ -300,7 +300,6 @@ class BaseLLM(ABC):
|
|||
if compress_type == CompressType.NO_COMPRESS:
|
||||
return messages
|
||||
|
||||
current_token_count = 0
|
||||
max_token = TOKEN_MAX.get(self.config.model, max_token)
|
||||
keep_token = int(max_token * threshold)
|
||||
compressed = []
|
||||
|
|
@ -318,7 +317,7 @@ class BaseLLM(ABC):
|
|||
# system_msgs = [msg for msg in messages if msg["role"] == system_msg_val]
|
||||
# user_assistant_msgs = [msg for msg in messages if msg["role"] != system_msg_val]
|
||||
compressed.extend(system_msgs)
|
||||
current_token_count += self.count_tokens(system_msgs)
|
||||
current_token_count = self.count_tokens(system_msgs)
|
||||
|
||||
if compress_type in [CompressType.POST_CUT_BY_TOKEN, CompressType.POST_CUT_BY_MSG]:
|
||||
# Under keep_token constraint, keep as many latest messages as possible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue