Skip to content

Commit

Permalink
ignore ZeroRetriever error when id_list provided (open-compass#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leymore authored and BunnyRunnerX committed Sep 4, 2023
1 parent e15b889 commit 7ce7d77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opencompass/openicl/icl_retriever/icl_zero_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from opencompass.openicl.icl_retriever import BaseRetriever
from opencompass.registry import ICL_RETRIEVERS
from opencompass.utils.logging import get_logger


@ICL_RETRIEVERS.register_module()
Expand All @@ -21,6 +22,8 @@ class ZeroRetriever(BaseRetriever):
def __init__(self, dataset, ice_eos_token: Optional[str] = '') -> None:
super().__init__(dataset, '', ice_eos_token, 0)

def retrieve(self) -> List[List]:
def retrieve(self, id_list: List[int]) -> List[List]:
if id_list:
get_logger().warning('id_list is not empty, but will be ignored.')
rtr_idx_list = [[] for _ in range(len(self.test_ds))]
return rtr_idx_list

0 comments on commit 7ce7d77

Please sign in to comment.