mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-24 03:18:21 -05:00
[PR #1756] [MERGED] feat: toggle hybrid search #124425
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/1756
Author: @buroa
Created: 4/25/2024
Status: ✅ Merged
Merged: 4/26/2024
Merged by: @tjbck
Base:
dev← Head:buroa/toggle-hybrid📝 Commits (3)
9755cd5feat: toggle hybrid search69822e4fix: sort ranking hybridcebf733refac: naming convention📊 Changes
5 files changed (+155 additions, -102 deletions)
View changed files
📝
backend/apps/rag/main.py(+26 -1)📝
backend/apps/rag/utils.py(+18 -18)📝
backend/config.py(+4 -0)📝
backend/main.py(+1 -0)📝
src/lib/components/documents/Settings/General.svelte(+106 -83)📄 Description
This is an update to my previous PR which adds a toggle for hybrid searching. Once toggled, it will unlock the reranking model field as well as the relevance score threshold. Even if you turn it on, you do not have to use reranking. It's only used if the reranking model is updated and set.
Also fixed a small issue where querying a collection would result in the scores out of order. Embeddings use a distance while reranking scores (0-1). This ensures the collections are ranked in reverse order when using hybrid + reranking, so they appear .99, .98. .97...; while embeddings (no reranking) are 300, 301, 302... respectively (this has not changed even with this PR).
Ref: #1693
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.