Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Can't make LLMReranker to runnable
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey committed Jan 4, 2024
1 parent 44b35d2 commit 8d36228
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion RAGchain/reranker/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
I modified the code to fit the RAGchain framework.
"""
import os
from typing import List
from typing import List, Optional

from langchain_core.runnables import RunnableConfig
from langchain_core.runnables.utils import Input, Output

from RAGchain.reranker.base import BaseReranker
from RAGchain.reranker.llm.rank_gpt import permutation_pipeline, sliding_windows
Expand All @@ -17,6 +20,10 @@ class LLMReranker(BaseReranker):
The LLM rerank the passages by question.
This reranker only supports the OpenAI models only.
"""

def invoke(self, input: Input, config: Optional[RunnableConfig] = None) -> Output:
raise NotImplementedError("LLMReranker does not support LCEL yet.")

def __init__(self, model_name: str = "gpt-3.5-turbo", api_base: str = None, *args, **kwargs):
self.model_name = model_name
self.api_base = api_base
Expand Down

0 comments on commit 8d36228

Please sign in to comment.