Commit ff64a3c0 by Archer Committed by archer

update search filter code (#4317)

* sync collection

* remove lock

* update search filter code
parent 37b4a191
......@@ -134,12 +134,10 @@ export const filterDatasetDataByMaxTokens = async (
let totalTokens = 0;
for await (const item of tokensScoreFilter) {
results.push(item);
totalTokens += item.tokens;
if (totalTokens > maxTokens + 500) {
break;
}
results.push(item);
if (totalTokens > maxTokens) {
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment