mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
Merge pull request #15705 from rgaricano/dev-HybridSearch-bm25_slider
FEAT: STYLE: Frontend HybridSearch-BM25 Slider
This commit is contained in:
commit
f41a8e67e8
1 changed files with 70 additions and 19 deletions
|
|
@ -1059,22 +1059,73 @@
|
|||
{/if}
|
||||
|
||||
{#if RAGConfig.ENABLE_RAG_HYBRID_SEARCH === true}
|
||||
<div class="mb-2.5 flex w-full justify-between">
|
||||
<div class="self-center text-xs font-medium">
|
||||
<div class=" py-0.5 w-full justify-between">
|
||||
<Tooltip
|
||||
content={$i18n.t(
|
||||
'The Weight of BM25 Hybrid Search. 0 more lexical, 1 more semantic. Default 0.5'
|
||||
)}
|
||||
placement="top-start"
|
||||
className="inline-tooltip"
|
||||
>
|
||||
<div class="flex w-full justify-between">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Weight of BM25 Retrieval')}
|
||||
</div>
|
||||
<div class="flex items-center relative">
|
||||
<button
|
||||
class="p-1 px-3 text-xs flex rounded-sm transition shrink-0 outline-hidden"
|
||||
type="button"
|
||||
on:click={() => {
|
||||
RAGConfig.HYBRID_BM25_WEIGHT = (RAGConfig?.HYBRID_BM25_WEIGHT ?? null) === null ? 0.5 : null;
|
||||
}}
|
||||
>
|
||||
{#if (RAGConfig?.HYBRID_BM25_WEIGHT ?? null) === null}
|
||||
<span class="ml-2 self-center"> {$i18n.t('Default')} </span>
|
||||
{:else}
|
||||
<span class="ml-2 self-center"> {$i18n.t('Custom')} </span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
{#if (RAGConfig?.HYBRID_BM25_WEIGHT ?? null) !== null}
|
||||
<div class="flex w-full justify-between">
|
||||
<div class=" text-left text-xs font-small">
|
||||
{$i18n.t('lexical')}
|
||||
</div>
|
||||
<div class=" text-right text-xs font-small" style="padding-right: 64px;">
|
||||
{$i18n.t('semantic')}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-0.5 space-x-2">
|
||||
<div class=" text-left text-xs font-small">
|
||||
{$i18n.t('lexical')}
|
||||
</div>
|
||||
<div class=" flex-1">
|
||||
<input
|
||||
class="flex-1 w-full text-sm bg-transparent outline-hidden"
|
||||
type="number"
|
||||
step="0.01"
|
||||
placeholder={$i18n.t('Enter BM25 Weight')}
|
||||
id="steps-range"
|
||||
type="range"
|
||||
min="0"
|
||||
max="1"
|
||||
step="0.05"
|
||||
bind:value={RAGConfig.HYBRID_BM25_WEIGHT}
|
||||
autocomplete="off"
|
||||
min="0.0"
|
||||
max="1.0"
|
||||
class="w-full h-2 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"
|
||||
/>
|
||||
</div>
|
||||
<div class=" text-right text-xs font-small">
|
||||
{$i18n.t('semantic')}
|
||||
</div>
|
||||
<div>
|
||||
<input
|
||||
bind:value={RAGConfig.HYBRID_BM25_WEIGHT}
|
||||
type="number"
|
||||
class=" bg-transparent text-center w-14"
|
||||
min="0"
|
||||
max="1"
|
||||
step="any"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Reference in a new issue