summaryrefslogtreecommitdiff
path: root/rag/retriever/rerank/__init__.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-24 09:09:24 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-24 09:09:24 +0200
commit9e0cbcb4e7f1f3f95f304046d3190c6ebc4d3901 (patch)
tree5d890ce2705b79f23d63988c140d08edadaf35c5 /rag/retriever/rerank/__init__.py
parent2e85325639ce3827cc2eb32f9750dfa873e3a480 (diff)
Reformat and fix typo
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)