summaryrefslogtreecommitdiff
path: root/rag/retriever/rerank/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'rag/retriever/rerank/__init__.py')
-rw-r--r--rag/retriever/rerank/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/rag/retriever/rerank/__init__.py b/rag/retriever/rerank/__init__.py
new file mode 100644
index 0000000..16b2fac
--- /dev/null
+++ b/rag/retriever/rerank/__init__.py
@@ -0,0 +1,15 @@
+from typing import Type
+
+from rag.retriever.rerank.abstract import AbstractReranker
+from rag.retriever.rerank.cohere import CohereReranker
+from rag.retriever.rerank.local import Reranker
+
+
+def get_reranker(model: str) -> Type[AbstractReranker]:
+ match model:
+ case "local":
+ return Reranker()
+ case "cohere":
+ return CohereReranker()
+ case _:
+ exit(1)