mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-29 05:37:14 +00:00
perf: 更加准确的字数估算
This commit is contained in:
@@ -74,7 +74,7 @@ class KeysManager:
|
|||||||
self.usage[md5] = 0
|
self.usage[md5] = 0
|
||||||
|
|
||||||
# 经测算得出的理论与实际的偏差比例
|
# 经测算得出的理论与实际的偏差比例
|
||||||
salt_rate = 0.93
|
salt_rate = 0.91
|
||||||
|
|
||||||
self.usage[md5] += ( (len(new_content.encode('utf-8')) - len(new_content)) / 2 + len(new_content) )*salt_rate
|
self.usage[md5] += ( (len(new_content.encode('utf-8')) - len(new_content)) / 2 + len(new_content) )*salt_rate
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user