mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
perf: token count (#1509)
This commit is contained in:
@@ -77,6 +77,7 @@ export const countGptMessagesTokens = (
|
||||
clearTimeout(timer);
|
||||
};
|
||||
|
||||
// 可以进一步优化(传递100w token数据,实际需要300ms,较慢)
|
||||
worker.postMessage({
|
||||
id,
|
||||
messages,
|
||||
|
@@ -111,6 +111,7 @@ parentPort?.on(
|
||||
data: total
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
parentPort?.postMessage({
|
||||
id,
|
||||
type: 'success',
|
||||
|
Reference in New Issue
Block a user