perf: token count (#1509)

This commit is contained in:
Archer
2024-05-16 17:05:56 +08:00
committed by GitHub
parent 6067f5aff3
commit 2d1ec9b3ad
4 changed files with 3 additions and 19 deletions

View File

@@ -77,6 +77,7 @@ export const countGptMessagesTokens = (
clearTimeout(timer);
};
// 可以进一步优化(传递100w token数据,实际需要300ms,较慢)
worker.postMessage({
id,
messages,