refac: reranker

Co-Authored-By: Tornike Gurgenidze <togurg14@freeuni.edu.ge>
This commit is contained in:
Timothy Jaeryang Baek
2025-05-23 01:29:48 +04:00
co-authored by Tornike Gurgenidze
parent f2d2cae8fb
commit aac25eac9e
3 changed files with 14 additions and 2 deletions
@@ -7,11 +7,13 @@ from colbert.modeling.checkpoint import Checkpoint
from open_webui.env import SRC_LOG_LEVELS
from open_webui.retrieval.models.base_reranker import BaseReranker
log = logging.getLogger(__name__)
log.setLevel(SRC_LOG_LEVELS["RAG"])
class ColBERT:
class ColBERT(BaseReranker):
def __init__(self, name, **kwargs) -> None:
log.info("ColBERT: Loading model", name)
self.device = "cuda" if torch.cuda.is_available() else "cpu"