mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
Modify budget calculation for text limit safety margin
Adjust budget calculation to use 92% margin for token estimation.
This commit is contained in:
parent
07d4527a0d
commit
b5e0ec2d8d
1 changed files with 1 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ class BaseEmbeddingStore(BaseComponent):
|
|||
return text[:limit]
|
||||
|
||||
# Reserve a 5% safety margin for token estimation.
|
||||
budget = limit * 2 * 95 // 100
|
||||
budget = limit * 2 * 92 // 100
|
||||
used = 0
|
||||
for index, char in enumerate(text):
|
||||
used += 3 if unicodedata.east_asian_width(char) in {"W", "F"} else 2
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue