Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Ignore ZeroRetriever error when id_list provided #340

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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