mirror of
https://github.com/open-webui/open-webui
synced 2024-11-21 23:57:51 +00:00
Merge pull request #6907 from clang88/patch-1
Update calculatePercentage CitationsModal.svelte (high percentage for high relevance)
This commit is contained in:
commit
4174738b1c
@ -13,9 +13,9 @@
|
|||||||
let mergedDocuments = [];
|
let mergedDocuments = [];
|
||||||
|
|
||||||
function calculatePercentage(distance: number) {
|
function calculatePercentage(distance: number) {
|
||||||
if (distance < 0) return 100;
|
if (distance < 0) return 0;
|
||||||
if (distance > 1) return 0;
|
if (distance > 1) return 100;
|
||||||
return Math.round((1 - distance) * 10000) / 100;
|
return Math.round(distance * 10000) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRelevanceColor(percentage: number) {
|
function getRelevanceColor(percentage: number) {
|
||||||
|
Loading…
Reference in New Issue
Block a user