mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 23:22:22 +00:00
perf: rrf code (#5558)
This commit is contained in:
@@ -18,7 +18,7 @@ export const datasetSearchResultConcat = (
|
||||
|
||||
item.list.forEach((data, index) => {
|
||||
const rank = index + 1;
|
||||
const score = (weight * 1) / (60 + rank);
|
||||
const score = weight * (1 / (60 + rank));
|
||||
const record = map.get(data.id);
|
||||
if (record) {
|
||||
// 合并两个score,有相同type的score,取最大值
|
||||
@@ -64,8 +64,9 @@ export const datasetSearchResultConcat = (
|
||||
});
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
delete item.rrfScore;
|
||||
return item;
|
||||
return {
|
||||
...item,
|
||||
rrfScore: undefined
|
||||
};
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user